f and Openinary picks the format from what the browser accepts: AVIF where possible, WebP next, JPEG or PNG otherwise.
How it works
1
Detect browser support
Reads the
Accept header and User-Agent to determine which modern formats
the client accepts.2
Pick the best supported format
Takes the first format the browser supports, in this order:AVIF → WebP → JPEG / PNGPNG originals stay PNG when neither AVIF nor WebP is available, so transparency survives.
3
Encode once and cache
Encodes to that single format at a quality chosen for it, then stores the
result. Every later request for the same URL is served from cache.
f_auto, and it does not inspect image content to pick a codec.
Comparing candidates with f_auto
f_auto opts into the slower, thorough path: Openinary encodes the image in every format the browser supports, compares the actual byte counts, and serves the smallest.
Quality defaults
With noq, quality follows the chosen format rather than a single fixed number:
Large files shift this by a few points, and the result is clamped to the 70 to 95 range. An explicit
q between 1 and 100 is used exactly as given.
Typical size reductions
Actual savings depend on the image and how well it was already compressed.
Manual format override
Use thef parameter to force a specific format regardless of browser support.
Next steps
Image Transformations
Full reference for resize, crop, rotate, and format parameters.
Upload & Cache Warming
Pre-generate optimized variants at upload time.