Image
Optimization
Image Optimization Transformations
Output Format
Control the output format using f_{format}
. Each format has specific use cases and benefits:
Auto Format (f_auto
)
Automatically selects the best format based on browser support:
Features:
- Delivers AVIF to supported browsers
- Falls back to WebP when AVIF isn’t supported
- Uses JPEG/PNG for legacy browsers
- Optimal format selection per request
Best for:
- Maximum compatibility
- Optimal performance
- No need for manual format selection
- Progressive enhancement
AVIF (f_avif
)
Next-generation format with superior compression:
Features:
- Best-in-class compression
- Excellent quality preservation
- Full color depth support
- HDR and wide color gamut support
- Alpha transparency
Best for:
- Maximum compression needs
- High-quality images
- Modern web applications
- When quality and size both matter
- Progressive web apps
WebP (f_webp
)
Modern format offering excellent compression:
Features:
- Great compression ratios
- Supports transparency
- Excellent quality-to-size ratio
- Progressive loading support
Best for:
- Modern web applications
- Performance-critical sites
- Mobile-first designs
- Wider browser support than AVIF
JPEG (f_jpeg
)
Standard format with wide compatibility:
Features:
- Universal browser support
- Good compression for photographs
- No transparency support
- Smaller file sizes than PNG
Best for:
- Photographs
- Legacy system compatibility
- When transparency isn’t needed
- High-color images
PNG (f_png
)
Lossless format with transparency support:
Features:
- Lossless quality
- Full transparency support
- Better for text and graphics
- Larger file sizes
Best for:
- Images with text
- Logos and icons
- Screenshots
- When quality is critical
Quality Control
Adjust compression quality using q_{value}
:
Numeric Quality
Direct control over compression level:
Features:
- Range: 1-100
- Higher values = better quality
- Lower values = smaller files
- Direct control over output
Auto Quality Modes
Intelligent quality optimization:
Features:
- Automatic optimization
- Consistent visual quality
- Optimal file size