hn.today

JPEG XL vs. AVIF for web use-cases

jakearchibald.com7 points0 comments
Screenshot of JPEG XL vs. AVIF for web use-cases

This is an empirical comparison of JPEG XL and AVIF for typical web use-cases, based on a battery of encodes, perceptual-quality metrics, and performance measurements. For lossy photographic images AVIF almost always yields smaller files: at default effort settings JPEG XL files tend to be ~15-25% larger, narrowing to ~6-20% at maximum effort. Two JPEG XL encoders behave very differently: jixel usually outperforms libjxl on size (except with detailed transparency) but requires much higher effort to match AVIF, while libjxl’s higher efforts are slow and memory-hungry with little quality gain. AVIF encodes and decodes faster and uses less RAM relative to file size; JPEG XL decoding is typically 2-3× slower at medium quality.

For screenshots, illustrations and images with alpha, AVIF is substantially better - JPEG XL can be 30-90% larger for screenshots and libjxl 31-70% larger for transparency, with jixel often forcing lossless alpha and producing 2-3× larger files. HDR support is handicapped by lack of browser-level JPEG XL gain-map support. Lossless use cases favor JPEG XL (smaller than lossless WebP or AVIF), but lossless is rarely needed on the web. Progressive previews differ: progressive JPEG XL is cheap at high effort in jixel; AVIF supports Chrome-only progressive rendering currently. Recommendation: default to AVIF 4:4:4 at the highest effort you can afford, and try jixel-encoded JPEG XL when AVIF produces unusually large files. Tests used avifenc 1.4.2, libjxl 0.12.0, jixel 0.4.2 and cwebp 1.6.0 on a 2024 MacBook Pro (M4 Pro), with images resized to 1,598 px.

Read on jakearchibald.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

Gnome OS Preview

Gnome OS Preview

GNOME Project has released GNOME OS Preview, a more stable version of its nightly build aimed at non-developers. The preview is built from the latest stable GNOME release and is intended for daily use, though it is not yet fully complete or stable for the general public. (lwn.net)

Gnome OS Preview

Gnome OS Preview

GNOME OS has launched a new preview edition built from the latest stable GNOME release, moving beyond its previous nightly testing phase. The update aims to make GNOME OS suitable for general users while continuing development efforts like improved hardware support and enhanced security features. (blogs.gnome.org)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.