Use picture sources
Offer AVIF first and WebP or JPEG as fallback. The browser picks the first format it understands.
AVIF wraps AV1 intra frames in a container. It is the best size-per-pixel of the mainstream formats, and it charges for that in encode time and decode support.
AVIF is not a new still-image design. It is one frame of a video codec, which explains both its efficiency and its cost.
AV1 was designed for streaming, where every bit matters. Its intra coding — the part that compresses a single frame without reference to previous ones — includes variable transform sizes, directional prediction from neighbouring blocks, and a range coder more efficient than JPEG's Huffman tables. Applied to a still image, those tools do exactly what they were built to do.
It also carries capability JPEG never had: 10-bit and 12-bit precision, wide-gamut and HDR signalling, alpha, and animation. A photograph delivered as an 8-bit JPEG has already lost information AVIF could have kept.
Those tools are expensive to search. An encoder must try many prediction and transform combinations per block, which is why AVIF encoding is measured in seconds per megapixel rather than milliseconds. Decoding is cheaper but still much heavier than JPEG, and older devices without hardware AV1 support fall back to software — noticeable on low-end phones.
The size advantage is real but not universal: fine text, flat UI and high-contrast line art often compress worse in AVIF than in lossless WebP, and visibly worse in quality terms at the same byte budget.
Directional ranges from the site benchmark work and the format design. Verify on your own folder before quoting them.
Our own measured WebP figures are on benchmarks; AVIF numbers vary enough by encoder version that we do not publish a single figure.
Four situations where the smallest file is not the best file.
The support tail is the whole problem, and it has a standard answer.
Offer AVIF first and WebP or JPEG as fallback. The browser picks the first format it understands.
Encode once during your build or upload step. Never encode AVIF in a request handler.
AVIF is a delivery artefact. The original stays untouched so you can re-derive everything later.
AVIF is the end of the size ladder, not the start.
Image formats compared places it against JPEG, PNG and WebP. What is WebP is the format it most often competes with, and JPG to AVIF and PNG to AVIF are the conversion paths.
Smaller at equal quality, slower to encode, and less supported. Which one is "better" depends on whether you are optimising bytes or risk.
Usually content: fine text or flat UI. Lossy codecs tuned for photographs can lose to lossless WebP on graphics.
Yes, including a separate alpha plane, which is one of the reasons it beats PNG on cut-out graphics.
Recent Photoshop versions can; most office suites and older editors cannot. Treat AVIF as a web delivery format.
It supports a lossless mode, but in practice it is almost always used lossy. Lossless PNG or WebP is usually a better choice.
Yes — 10-bit and 12-bit with HDR signalling, which JPEG cannot represent at all.
Batch the slow encode on your own machine, then ship the result with a fallback.