Format Conversion
Convert images between formats for optimal delivery.
The f parameter converts images to a different format during delivery.
Supported Formats
| Value | Format | Notes |
|---|---|---|
jpeg | JPEG | Best for photographs. Aliases: jpg, jpe, jif, jfif, jfi |
png | PNG | Lossless, supports transparency |
webp | WebP | Modern format, smaller files. Max 2000px dimension |
avif | AVIF | Most efficient compression. Max 2000px dimension |
tiff | TIFF | High quality, large files |
gif | GIF | Animated images, limited colors |
pdf | Document format |
Usage
# Convert to WebP
?f=webp
# Convert to AVIF with quality
?f=avif&q=70
# Convert to JPEG
?f=jpeg
Auto-Format Negotiation
When f is not specified, Tuzzle reads the browser's Accept header and selects the best format automatically:
- AVIF if the client supports
image/avif - WebP if the client supports
image/webp - Original format as fallback
This delivers the smallest possible file without any changes to your URLs.
HEIC/HEIF Input
HEIC and HEIF images (common from iPhones) are automatically converted to JPEG on delivery. These formats cannot be used as output formats due to patent restrictions.
WebP and AVIF Limits
Both WebP and AVIF have a maximum dimension of 2000 pixels. If your transformation would produce an image larger than 2000px in either dimension:
- In
fitmode, the image is automatically scaled down - In
croporscalemode, a422error is returned - A warning is included in the
x-tzzl-warningsheader
Format-Specific Optimizations
Tuzzle applies format-specific optimizations automatically:
| Format | Optimizations |
|---|---|
| JPEG | MozJPEG encoder, progressive encoding |
| PNG | Compression level 9, adaptive filtering |
| WebP | Lossy encoding |
| AVIF | 4:2:0 chroma subsampling |
| TIFF | LZW compression |