The case against JPEG XL

The case against JPEG XL

反对 JPEG XL 的理由

Investigating JPEG XL’s place as a Web image codec. Why? JPEG XL is a technically impressive image codec; it is a definitive upgrade over JPEG, more versatile than WebP, and well-equipped to serve use cases beyond the Web. However, it was famously rejected from Chrome in 2023. Because this happened to a royalty-free, flexible, compression-efficient codec from the JPEG Committee that was receiving attention from large companies, the decision didn’t land well with many.

探讨 JPEG XL 作为 Web 图像编解码器的地位。为什么?JPEG XL 是一款技术上令人印象深刻的图像编解码器;它是 JPEG 的决定性升级,比 WebP 更通用,并且非常适合 Web 之外的应用场景。然而,它在 2023 年被 Chrome 拒绝,这一事件广为人知。由于这是一个来自 JPEG 委员会、免版税、灵活且压缩效率高的编解码器,且受到了大公司的关注,这一决定让许多人感到不满。

Recently, a JPEG XL decoder in Rust has made its way into Firefox and Chrome in some capacity. The Web’s major stakeholders may therefore be reversing course on JPEG XL given that the new decoder may protect the Web from reliving 2023’s WebP vulnerability. Is this all it took to justify JPEG XL for the Web?

最近,一个用 Rust 编写的 JPEG XL 解码器已以某种形式进入了 Firefox 和 Chrome。鉴于新的解码器可能保护 Web 免于重蹈 2023 年 WebP 漏洞的覆辙,Web 领域的主要利益相关者可能正在改变对 JPEG XL 的态度。难道这就是证明 JPEG XL 在 Web 上合理性的全部理由吗?

Historically, I’ve been a big proponent of JPEG XL for all use cases. I endorsed JPEG XL for Interop 2024, and I’ve interacted with Jon Sneyers and Jyrki Alakuijala (two of the format’s primary authors) personally many times. I’m consistently impressed with their public conduct, level-headedness, technical aptitude, and passion for the field. This piece does not seek to discredit the format’s authors or their work, nor to claim any political affiliation relative to the codec’s symbolism in free software. The spirit of this post is educational; I want to offer an empirical look at the current state of image compression and the Web platform in 2026. Some inspiration is drawn from RISC-V: They Should Have Known Better by Dmitry Grinberg.

从历史上看,我一直是 JPEG XL 在所有用例中的坚定支持者。我曾为 Interop 2024 推荐过 JPEG XL,并多次与该格式的主要作者 Jon Sneyers 和 Jyrki Alakuijala 进行过个人交流。他们的公众行为、冷静头脑、技术能力以及对该领域的热情一直令我印象深刻。本文无意诋毁该格式的作者或他们的工作,也不打算宣称与该编解码器在自由软件中的象征意义有任何政治关联。本文旨在科普;我希望从实证角度审视 2026 年图像压缩和 Web 平台的现状。部分灵感来源于 Dmitry Grinberg 的《RISC-V: They Should Have Known Better》。

The Web

Web 平台

I do image compression work, coming from video compression originally. While working on an AV1 encoder, Julio Barba and I made significant advancements to AVIF, and I learned a lot in the process. When I decided to start building my own encoder, I had to think very hard about which formats I felt had the highest ceilings, could be effectively optimized, and had the most present and potential utility. I decided not to work with JPEG XL.

我从事图像压缩工作,最初是做视频压缩的。在开发 AV1 编码器时,我和 Julio Barba 对 AVIF 做了重大改进,在此过程中我学到了很多。当我决定开始构建自己的编码器时,我必须认真思考哪些格式具有最高的上限、可以被有效优化,并具有最大的现实和潜在效用。我决定不使用 JPEG XL。

By volume, there are very few use cases on the Web that aren’t served by versatile lossy compression. The average Web consumer doesn’t need lossless; they just need a lossy codec versatile enough to prevent terrible artifacts (e.g. JPEG on non-photographic content). This rules out JPEG XL’s lossless advantage, which in practice is only roughly 11.9% smaller than lossless WebP anyway – and on an unrealistic test dataset for the Web (157 MP photos, 10 MP illustrations, and 27 MP books). It cannot be worth bringing a new image codec to browsers to save 12% on a tiny volume of image content with use cases inherently less sensitive to bandwidth constraints. I say this because JPEG XL isn’t competitive for lossy, so lossless would be its only real advantage.

从数据量来看,Web 上很少有通用有损压缩无法满足的用例。普通 Web 用户不需要无损压缩;他们只需要一种足够通用的有损编解码器来防止严重的伪影(例如非摄影内容上的 JPEG 伪影)。这排除了 JPEG XL 的无损优势,实际上它仅比无损 WebP 小约 11.9%——而且是在一个对 Web 而言不切实际的测试数据集(157 张照片、10 张插图和 27 本书)上得出的。为了在极少量的图像内容上节省 12% 的空间,且这些用例本身对带宽限制不敏感,引入一种新的图像编解码器是不值得的。我之所以这么说,是因为 JPEG XL 在有损压缩方面并不具备竞争力,因此无损压缩将是它唯一的真正优势。

Lossy Compression Efficiency

有损压缩效率

One of the original arguments for JPEG XL was that its reference encoder was more perceptually optimized than competing encoders. Now, on both speed and fidelity per bit, other encoders are stronger. The AV1 reference encoder received specialized perceptual tuning based on controlled subjective human trials to strengthen its efficiency while maintaining a tuning mode optimized for perceptual metrics. SVT-AV1 has similar tuning modes. There is no compelling argument that modern encoders aren’t tuned for the human eye. Metrics aren’t perfect, but they paint a daunting picture for JPEG XL.

JPEG XL 最初的论点之一是其参考编码器比竞争对手的编码器在感知上进行了更好的优化。现在,无论是在速度还是单位比特的保真度上,其他编码器都更强。AV1 参考编码器基于受控的主观人类测试进行了专门的感知调优,以增强其效率,同时保持一种针对感知指标优化的调优模式。SVT-AV1 也有类似的调优模式。没有任何令人信服的论据表明现代编码器没有针对人眼进行调优。指标虽然不完美,但它们为 JPEG XL 描绘了一幅令人望而生畏的图景。

(Note: The original text includes references to metrics like CVVDP, SSIM, and SSIMULACRA2, and mentions an upcoming encoder “Aperture”.)

(注:原文提及了 CVVDP、SSIM 和 SSIMULACRA2 等指标,并提到了即将推出的编码器“Aperture”。)

Some analysis claims that JPEG XL underperforms in metrics relative to its perceptual strength, but I don’t see sufficient evidence that this is to the degree that graphs like the ones I shared could be secretly completely reversed. CVVDP and SSIMULACRA2 are very strong perceptual metrics, and definitely tell us something when the differences are this great. For AVIF, libaom’s perceptually optimized tune (tune IQ) is only a couple of points lower than its perceptual-metric-optimized tune (tune SSIMULACRA2). Plus, the JPEG XL reference encoder has historically suffered from perceptual issues that remain largely unresolved.

一些分析声称 JPEG XL 在指标上的表现与其感知强度相比被低估了,但我没有看到足够的证据表明这种程度足以让像我分享的那样的图表被完全颠覆。CVVDP 和 SSIMULACRA2 是非常强大的感知指标,当差异如此巨大时,它们肯定说明了一些问题。对于 AVIF 来说,libaom 的感知优化调优(tune IQ)仅比其感知指标优化调优(tune SSIMULACRA2)低几个点。此外,JPEG XL 参考编码器在历史上一直存在感知问题,且这些问题在很大程度上仍未解决。

There’s no such thing as a codec benchmark, only an encoder benchmark; in theory, the ceiling for JPEG XL as a format is higher than libjxl is getting. But how hard would it be to close the gap? As a compression engineer, I believe it is disadvantaged here. Some reasons: JPEG XL doesn’t have directional prediction modes. Compressed images are divided into VarDCT blocks (from 2x2 up to 256x256) and transformed into frequency representations of their pixels. Other block-based image codecs like WebP let you predict a block’s pixels using surrounding data, subtract this prediction from the actual pixels, and then do the frequency transform. Directional prediction modes can result in blur if your encoder isn’t perceptually optimized, but strong mode-decision pipelines can pick the right mode for the job and save lots of bits. For example, edge preservation is stronger in codecs with directional pred, while JXL is weaker here.

不存在所谓的“编解码器基准测试”,只有“编码器基准测试”;理论上,JPEG XL 作为一种格式的上限要高于 libjxl 目前的表现。但要缩小这一差距有多难?作为一名压缩工程师,我认为它在这里处于劣势。原因如下:JPEG XL 没有方向预测模式。压缩图像被划分为 VarDCT 块(从 2x2 到 256x256),并转换为像素的频率表示。其他基于块的图像编解码器(如 WebP)允许您使用周围数据预测块的像素,从实际像素中减去此预测值,然后进行频率变换。如果您的编码器没有进行感知优化,方向预测模式可能会导致模糊,但强大的模式决策流水线可以选择正确的模式并节省大量比特。例如,具有方向预测的编解码器在边缘保留方面更强,而 JXL 在这方面较弱。

The proposed solution for the edge-preservation gap is splines, which are vastly more difficult to use. The hard part is on the encoder side: you need an efficient algorithm to figure out which pixels can even be represented as a spline, then feed every candidate through RDO to decide whether it’s worth coding. There’s no existing PoC for using splines for edge preservation, and I have no reason to believe they’d be better than dir-pred anyway. JPEG XL doesn’t have deblocking loop filtering (DLF), or any deblocking filter. It does have two in-loop tools that are sometimes offered as partial equivalents: gaborish, which is the closest thing JXL has to AV1’s loop restoration filtering, and EPF (edge-preserving filter), whose closest analogue is AV1’s CDEF. Neither is a deblocking filter, and the two together can’t fully replace proper DLF. The DLF can smooth images…

针对边缘保留差距提出的解决方案是样条曲线(splines),但其使用难度要大得多。难点在于编码器端:你需要一种高效的算法来确定哪些像素可以用样条曲线表示,然后将每个候选对象通过 RDO(率失真优化)来决定是否值得编码。目前还没有使用样条曲线进行边缘保留的验证性原型(PoC),而且我没有理由相信它们会比方向预测更好。JPEG XL 没有去块环路滤波(DLF)或任何去块滤波器。它确实有两种有时被视为部分替代品的环路内工具:gaborish(JXL 最接近 AV1 环路恢复滤波的工具)和 EPF(边缘保留滤波器,最接近 AV1 的 CDEF)。两者都不是去块滤波器,两者结合也无法完全替代合适的 DLF。DLF 可以平滑图像……