Format Conversion
Selecting an Output Format
Use the format parameter to convert the image to a different format on the fly.
/format=webp/https://example.com/photo.jpg
If format is not specified, the output format matches the input format - no conversion is applied.
Supported output formats
| Value | Description |
|---|---|
webp | WebP - good compression with transparency support |
jpeg | JPEG - universal compatibility, lossy |
png | PNG - lossless, supports transparency |
avif | AVIF - best compression, slower encoding |
gif | GIF - animated image support |
bmp | BMP - uncompressed bitmap |
tiff | TIFF - high-quality, lossless |
ico | ICO - Windows icon format |
jxl | JPEG XL - next-gen, wide gamut support |
Quality
The q parameter controls lossy compression quality for JPEG and WebP output.
| Param | Type | Range | Default |
|---|---|---|---|
q | integer | 1-100 | Encoder default |
Higher values produce larger files with better quality. Lower values produce smaller files with more compression artifacts.
/webp,q85/https://example.com/photo.jpg
/jpeg,q70/https://example.com/photo.jpg
The q parameter only applies to jpeg and webp output. It has no effect on lossless formats such as png, bmp, or tiff.
Format Comparison
| Format | Compression | Transparency | Animation | Notes |
|---|---|---|---|---|
webp | Good (lossy/lossless) | Yes | Yes | Broad browser support, ideal for web |
avif | Excellent | Yes | Yes | Smaller files than WebP, slower to encode |
jxl | Excellent | Yes | Yes | Next-gen format, wide color gamut |
jpeg | Good (lossy) | No | No | Universal compatibility, best for photos |
png | Moderate (lossless) | Yes | No | Best for graphics, logos, screenshots |
gif | Low | Partial (1-bit) | Yes | Legacy animated format |
bmp | None (uncompressed) | No | No | Raw pixels, large file size |
tiff | Optional (lossless) | Yes | No | High-quality archival use |
ico | - | Yes | No | Resized to standard icon sizes |
For web use, prefer webp or avif. WebP is well-supported across all modern browsers and offers a good balance of quality and file size. AVIF provides better compression but may be slower to generate for large images.
ICO Output
When format=ico is specified, the image is resized to standard Windows icon dimensions before encoding. This makes it suitable for use as a favicon or application icon.
/format=ico/https://example.com/logo.png
Examples
Convert JPEG to WebP
/format=webp/https://example.com/photo.jpg
Convert to WebP with quality
/webp,q85/https://example.com/photo.jpg
Resize and convert in one request
/800x600,webp,q80/https://example.com/photo.jpg
Lossless PNG output
/format=png/https://example.com/photo.jpg
Generate a favicon
/32x32,ico/https://example.com/logo.png
High-efficiency AVIF for bandwidth savings
/avif,q75/https://example.com/photo.jpg