JPEG XL vs. AVIF for web use-cases

289 points · 191 comments on HN · read original →

Points and comments are a snapshot, not live.

AVIF usually beats JPEG XL on file size and speed for lossy web photos.

Jake Archibald tested JPEG XL and AVIF across lossy photos, screenshots, illustrations, transparency, HDR, lossless, and progressive rendering. AVIF produced files 15-25% smaller for lossy photos at default settings, and 30-90% smaller for screenshots. AVIF is faster to encode and decode, and uses less memory. JPEG XL wins only for lossless images and for recompressing existing JPEGs 9-20% smaller without quality loss. jixel, a newer JPEG XL encoder, often beats libjxl but still trails AVIF. The author recommends defaulting to AVIF 4:4:4 with highest effort, testing JPEG XL only if AVIF produces an unusually large file.

What commenters are saying

A top comment argues AVIF's container-based design allows future codecs (AV2, AV3) to ship without new site adoption hurdles, unlike JPEG XL. Others counter that the container is useless if decoders lack the newer codec, and that content negotiation will still require new parameters. Several commenters note JPEG XL's JPEG transcoding is its standout feature for archives. The thread splits between those favoring AVIF for web use and those seeing JPEG XL's lossless and recompression strengths as valuable. Browser adoption and HDR support are also noted as ongoing issues.