Format Conversion

Convert images between formats for optimal delivery.

The f parameter converts images to a different format during delivery.

Supported Formats

ValueFormatNotes
jpegJPEGBest for photographs. Aliases: jpg, jpe, jif, jfif, jfi
pngPNGLossless, supports transparency
webpWebPModern format, smaller files. Max 2000px dimension
avifAVIFMost efficient compression. Max 2000px dimension
tiffTIFFHigh quality, large files
gifGIFAnimated images, limited colors
pdfPDFDocument 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:

  1. AVIF if the client supports image/avif
  2. WebP if the client supports image/webp
  3. 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 fit mode, the image is automatically scaled down
  • In crop or scale mode, a 422 error is returned
  • A warning is included in the x-tzzl-warnings header

Format-Specific Optimizations

Tuzzle applies format-specific optimizations automatically:

FormatOptimizations
JPEGMozJPEG encoder, progressive encoding
PNGCompression level 9, adaptive filtering
WebPLossy encoding
AVIF4:2:0 chroma subsampling
TIFFLZW compression