Jake Archibald benchmarked JPEG XL against AVIF, and AVIF won most of the web

Matched at the same visual quality, the best JPEG XL photos came out 15-25% larger than AVIF at default effort. Screenshots were worse.

In brief

Archibald tested avifenc, libjxl, jixel and cwebp on an M4 Pro, scoring with SSIMULACRA2. JPEG XL lost on lossy photos and screenshots (30-90% larger), but dominated lossless and can recompress existing JPEGs 9-20% smaller.

Commenters disputed whether the benchmark or Chrome's earlier decision was the real story.

The test: same quality, then compare bytes

Hero image from Jake Archibald's post
Hero image from Jake Archibald's post

Jake Archibald's comparison encoded images with avifenc 1.4.2, libjxl 0.12.0, jixel 0.4.2 and cwebp 1.6.0, mostly resized to 1598 px wide (twice his blog's display width), and matched files on SSIMULACRA2 with ColorVideoVDP as a second metric. It measured file size, encode time, memory and decode time in Firefox, Chrome and Safari.

His default recommendation is AVIF in 4:4:4 at the highest practical effort, with JPEG XL via jixel as a second check when AVIF's output is unusually big. Lossy photos: JPEG XL 15-25% larger at default effort, 6-20% at maximum. Screenshots and illustrations: 30-90% larger at default. Transparency: libjxl 31-44% larger, and jixel always encodes alpha losslessly, producing files 2-3 times AVIF's size. AVIF generally decoded faster, with JPEG XL taking 2-3 times as long at medium quality. In JPEG XL's favour: lossless (lossless WebP was 9-17% bigger for photos and lossless AVIF 30-120% bigger) and lossless JPEG transcoding that shrinks existing files 9-20%. He warns JPEG XL lacks browser support for HDR gain maps.

The thread: "the numbers don't match the claim"

One reader said they had thought JPEG XL was the best option broadly and asked whether the numbers contradict that. The practical answer came quickly:

"JPEG-XL can be a quick win since it is possible to do a transcode of all of your existing ('classic') JPEG files with zero (visual) losses in quality." — a commenter on recompressing old JPEG archives

A long-time forum member split the field by purpose:

"JPEG-XL is not the best solution if you want small low-quality images, to reduce your costs for hosting some Web site. AVIF seems appropriate for that goal." — a commenter who wants high-quality archives

The politics came in via Chrome. Another commenter said many people disliked Google blocking JPEG XL rather than letting it compete on merit. One more argument for AVIF was structural:

"I think one overlooked aspect is that AVIF is container based." — a commenter on future codec upgrades

The reasoning: when AV2 and later codecs arrive, sites will not need another adoption cycle.

Pick by workload

The post's own warning applies: test with your own images, since both codecs improve quickly. The dividing line in the data is clear enough to act on: AVIF for delivery of lossy web images, JPEG XL where lossless fidelity or recompressing a JPEG archive is the point.

Get breakdowns like this every day

The top Hacker News stories, unpacked — by email, Telegram, or RSS.

Next story · 7 of 13 Read more
🌍Other

eBay now demands FCC IDs for radio gear, but exempts ham-band-only transmitters

New FCC rules that took effect October 13 put part of the legal burden on marketplaces. eBay's first notices to sellers sounded as if every radio needed an FCC ID.

★ 176 · 💬 138 · arrl.org · 3 min