After uploading an image to Storyblok, you can use the resizing service to optimize, resize, and crop them in various ways.
Options
Resizing
Go to your browser and enter in the URL:
You should see the image with 500px of width and 500px of height. But play with the dimensions in the URL, and you'll see the image change accordingly.
If you want the dimensions to be propositional, you can enter a height of 0:
Fit in
The fit-in argument specifies that the image should not be auto-cropped but rather auto-resized (shrank) to fit in an imaginary box of width and height. To fill out the box with a color, you can use the fill filter filters:fill(CCCCCC) with a hexadecimal RGB expression (without the “#” character).
Example 1
The output with a grey fill color filters:fill(CCCCCC):
Example 2
The output with a transparent fill color filters:fill(transparent) and transformed into a PNG:
Changing the format
You can also change the output format of any image you upload. Possible options include “webp”, “jpeg”, “gif”, “png” or "avif".
Example
The output with a jpg picture transformed to an avif:
Adjusting the quality
You can also change the compression rate of the jpg image using the quality filter. The value can be anything between 0 and 100.
hint:
Only available in JPG format.
Example
Here's a jpg picture with a compression rate of 10:
🍪 Cookie Notice
We use cookies to learn how you interact with our content, and show you relevant content and ads based on your browsing history. You can adjust your settings below. Here's our policy.