🔃 Format Conversion
Supported input formats
As stated elsewhere, (but we can't stress it enough) Edge-Resizer delegates to images.weserv.nl's API, and because of that, we're able to read from quite a few formats including, but not limited to, JPG, PNG, AVIF, GIF, TIFF, PDF, SVG, ICO, WEBP.
The following formats can be safely read, but you cannot use them as output:
ICO | HEIC | SVG | AVIF | |
---|---|---|---|---|
WARNING
Conversion from SVG can yield unexpected results when referencing non-standard fonts and not embedding them.
Output
(See 🔗 weserve's docs about output)
Using the output
parameter, you can have the outcome transformed to jpg
, png
, gif
, and webp
formats. tiff
format is also supported, but it can't be displayed inline. click to download the tiff output
When not specified, it defaults to the input format as long as it's among the former. Other formats that are valid inputs will gracefully fallback to supported output formats (mostly png and jpg tbh)
<zone>/w=150_
output=jpg
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
jpg
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
output=png
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
png
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
output=gif
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
gif
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
output=webp
/riff.one/images/designcue-unsplash.jpg
<zone>/w=150_
webp
/riff.one/images/designcue-unsplash.jpg
The "filename" parameter
Though we don't support the filename parameter (you still can pass it as query param) we send the proper header so that "save as" on a given file offers its name instead of a generic "image.png". The extension is taken from the content type so it's consistent across format conversions.
Compression/Optimization
- af: Adaptative Filter (only works on png)
- l: Compression Level (number between 0 and 9. Only works on png, default 6)
- q: Quality (only works on jpg, tiff and webp. number between 0 and 100, default 80)
- il: Interlaced/Progressive
png | jpg | webp |
---|---|---|