The case against JPEG XL

Sep 14, 2026 08:02 AM - 3 hours ago 3

Investigating JPEG XL's spot arsenic a Web image codec.

Caustics

Why?

JPEG XL is simply a technically awesome image codec; it is simply a definitive upgrade over JPEG, much versatile than WebP, and well-equipped to service usage 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 ample companies, the determination didn't onshore good pinch many.

Recently, a JPEG XL decoder successful Rust has made its measurement into Firefox and Chrome successful immoderate capacity. The Web's awesome stakeholders may truthful beryllium reversing people connected JPEG XL fixed that the caller decoder may protect the Web from reliving 2023's WebP vulnerability. Is this each it took to warrant JPEG XL for the Web?

Historically, I've been a large proponent of JPEG XL for each usage cases. I endorsed JPEG XL for Interop 2024, and I've interacted pinch Jon Sneyers and Jyrki Alakuijala (two of the format's superior authors) personally galore times. I'm consistently impressed pinch their nationalist conduct, level-headedness, method aptitude, and passion for the field.

This portion does not activity to discredit the format's authors aliases their work, nor to claim immoderate governmental affiliation comparative to the codec's symbolism successful free software. The tone of this station is educational; I want to connection an empirical look astatine the existent authorities of image compression and the Web level successful 2026. Some inspiration is drawn from RISC-V: They Should Have Known Better by Dmitry Grinberg.

The Web

I do image compression work, coming from video compression originally. While moving connected an AV1 encoder, Julio Barba and I made significant advancements to AVIF, and I learned a lot successful the process. When I decided to commencement building my ain encoder, I had to deliberation very difficult astir which formats I felt had the highest ceilings, could beryllium efficaciously optimized, and had the astir coming and imaginable utility. I decided not to activity pinch JPEG XL.

By volume, location are very fewer usage cases connected the Web that aren't served by versatile lossy compression. The mean Web user doesn't request lossless; they conscionable request a lossy codec versatile capable to forestall unspeakable artifacts (e.g. JPEG connected non-photographic content). This rules retired JPEG XL's lossless advantage, which successful believe is only roughly 11.9% smaller than lossless WebP anyhow – and connected an unrealistic trial dataset for the Web (157 MP photos, 10 MP illustrations, and 27 MP books). It cannot beryllium worthy bringing a caller image codec to browsers to prevention 12% connected a mini measurement of image contented pinch usage cases inherently little delicate to bandwidth constraints. I opportunity this because JPEG XL isn't competitory for lossy, truthful lossless would beryllium its only existent advantage.

Lossy Compression Efficiency

One of the original arguments for JPEG XL was that its reference encoder was more perceptually optimized than competing encoders. Now, connected some velocity and fidelity per bit, different encoders are stronger.

The AV1 reference encoder received specialized perceptual tuning based connected controlled subjective quality tests to strengthen its ratio while maintaining a tuning mode optimized for perceptual metrics. SVT-AV1 has similar tuning modes. There is nary compelling statement that modern encoders aren't tuned for the quality eye.

Metrics aren't perfect, but they overgarment a daunting image for JPEG XL:

aperture-alpha is Halide Compression's upcoming encoder, codenamed Aperture. I included it to show conscionable really overmuch crushed libjxl needs to dress up to compete at the frontier.

Some study claims that JPEG XL underperforms successful metrics relative to its perceptual strength, but I don't spot capable grounds that this is to the grade that graphs for illustration the ones I shared could beryllium secretly completely reversed. CVVDP and SSIMULACRA2 are very beardown perceptual metrics, and decidedly show america something erstwhile the differences are this great. For AVIF, libaom's perceptually optimized tune is only a mates of points little than its perceptual-metric-optimized tune. Plus, the JPEG XL reference encoder has historically suffered from percep tual issues that stay largely unresolved.

There's nary specified point arsenic a codec benchmark, only an encoder benchmark; in theory, the ceiling for JPEG XL arsenic a format is higher than libjxl is getting. But really difficult would it beryllium to adjacent the gap? As a compression engineer, I believe it is disadvantaged here. Some reasons:

  • JPEG XL doesn't person 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 fto you foretell a block's pixels utilizing surrounding data, subtract this prediction from the existent pixels, and past do the wave transform. Directional prediction modes tin consequence successful blur if your encoder isn't perceptually optimized, but beardown mode-decision pipelines tin prime the right mode for the occupation and prevention tons of bits. For example, separator preservation is stronger successful codecs pinch directional pred, while JXL is weaker here.
  • The projected solution for the edge-preservation spread is splines, which are vastly much difficult to use. The difficult portion is connected the encoder side: you need an businesslike algorithm to fig retired which pixels tin moreover beryllium represented arsenic a spline, past provender each campaigner done RDO to determine whether it's worth coding. There's nary existing PoC for utilizing splines for separator preservation, and I have nary logic to judge they'd beryllium amended than dir-pred anyway.
  • JPEG XL doesn't person deblocking loop filtering (DLF), aliases immoderate deblocking filter. It does person 2 in-loop devices that are sometimes offered arsenic partial equivalents: gaborish, which is the closest point JXL has to AV1's loop restoration filtering, and EPF (edge-preserving filter), whose closest analogue is AV1's CDEF. Neither is simply a deblocking filter, and the 2 together can't afloat switch due DLF. The DLF tin soft images out, but if your encoder is smart it will only thief you debar mosquito noise, which JPEG XL still suffers from.
  • JPEG XL's perceptual "XYB" colorspace is based connected a batch of intuition, and doesn't ever construe to gains successful different formats (like JPEG) moreover when metrics for illustration SSIMULACRA2 activity successful the nonstop aforesaid colorspace. The claimed efficiency savings from utilizing XYB besides aren't arsenic large arsenic primitively advertised because libjxl presently relies connected aggressively quantizing the B channel. This has resulted successful subpar colour preservation, which caller JXL encoder developers must explicitly undo.
  • JXL does poorly pinch non-photographic images. The projected solution is using patches, but they are much difficult to usage than AV1's Intra Block Copy.
    • To get a akin scope of expressiveness to IntraBC, the encoder has to deal with further concepts for illustration layers and blending, which aren't inexpensive to represent astatine the bitstream level.
    • Residual coding is awkward. With AV1, you foretell a block, subtract the prediction from the source, and the toggle shape coefficients naturally represent the residual. With JXL's construction, you decode a residual frame and past blend a reference patch, truthful you request an existent framework aliases furniture whose decoded pixels correspond the residual. That would apt beryllium a Modular frame, which is absorbing because Modular isn't restricted to conventional unsigned image values the measurement the last rendered image is.
    • An IntraBC artifact fundamentally costs a mobility vector positive residual coefficients, whereas a JXL building perchance costs a reference frame, a framework header, a crop, blend information, a spot dictionary entry, patch coordinates, and a residual frame. That overhead tin overwhelm the savings unless the repeated region is reasonably ample aliases reused galore times.
    • Patches person to beryllium explicitly enabled successful libjxl beneath effort 7 because they currently person capacity issues.

For non-photographic images, the statement that “they should beryllium vector images” doesn't clasp up because galore images could beryllium vector images but aren't, and they can't beryllium vectorized perfectly. “The world should beryllium different” is not a justifiable defense against optimizing for the measurement the world actually is.

It is tempting to deliberation these points mean the ceiling is higher than libjxl lets us scope and that we could do better, but I'm not assured it tin eclipse well-optimized AVIF encoders quickly, fixed its little intuitive (and potentially weaker) coding tools.

Decode Time

JPEG XL has an impressively elastic specification. In summation to its coding tools, it supports up to 4096 channels, arbitrary colour depth, progressive decode, JPEG recompression, and more. Many of these features are not broadly useful connected the Web; you request 4 channels (RGB/YUV + alpha), reasonable color depth to support HDR (10-bit is fine), and the expertise to load quickly.

Progressive rendering (which AVIF supports) decodes a low-fidelity rendition before the afloat image arrives. AVIF didn't support progressive rendering for a while, and during that clip I judge it was profoundly oversold. Now that libavif has implemented it (it was ever possible), the speech appears to be over. I deliberation this is because the results speak for themselves:

AVIF Progressive Decode

This is from the JPEG-XL info site, where AVIF shows a usable image overmuch earlier than JXL astatine conscionable ~2-3% of the full image's size. Combined pinch the truth that the AVIF is smaller overall, this is an easy win. I've screenshotted the page because the AVIF progressive decode only useful successful Chrome, arsenic it is utilizing the browser's autochthonal decoder; JPEG XL uses a polyfill because moreover successful Safari wherever it is supported, progressive decode isn't.

JPEG recompression is the expertise to losslessly re-encode JPEGs arsenic JXL images while redeeming bits; the oft-cited number is 20% savings. However, the personification pays for this successful decode time, arsenic recompressed JPEGs return ~33% longer to decode. Modern user devices are powerful, but the statement that the savings come “for free” is misleading.

On that topic, decode clip is not competitory pinch the best:

Decode Time

In nationalist discourse, AVIF is considered slow to decode; what does that make JXL? This is besides a 10-bit AVIF, and each images were size-matched encodes of the same source. The JPEG was 2,478,828 bytes, the JPEG XL was 2,599,428, the AVIF 2,649,949, and WebP 2,693,794. WebP is complete 90kb larger and still manages to decode complete 10x faster than jxl-rs pinch wpd.

Due to the codec's expressivity, it is imaginable to trade images that take obscenely agelong to decode. Take this example (open pinch caution) that computes primes up to 33,599 and takes 17.43s of personification clip to decode connected my M5 Pro pinch the Rust decoder. Additionally, support successful mind that this is the decoder making its measurement into Chrome, Firefox, etc – the premier wall image is conscionable 1,918 bytes, truthful it's astir to go trivially easy to JXL-bomb low-end devices. You can already vessel a mates twelve of these connected a Web page and slow Apple devices down, arsenic they natively support JPEG XL successful Safari.

Conclusion and Opinion

I judge Web codecs should beryllium purpose-built, efficient, and narrowly scoped to the needs of the Web. I deliberation WebP was a spot excessively narrowly scoped, but the idea was there; AVIF's instrumentality could beryllium better, and the AV1 spec could beryllium a bit more circumstantial astir handling definite properties of images (e.g. normative 4:2:0 upsampling), but AVIF was ever a guaranteed summation to the Web owed to AV1 and benefits from a very mature ecosystem.

Do we request JPEG XL then? It isn't narrowly scoped whatsoever; it is meant to be everything to everyone, by design. I deliberation a batch of different usage cases request this, but the Web needs to prevention bandwidth, decode fast, and forestall foot-guns; I don't see really JPEG XL is moreover arsenic bully a fresh arsenic WebP. Not to mention an additional compatibility headache now exists for anyone conscionable trying to download an image from the Internet and usage it location – it was difficult capable to get widespread WebP adoption, and I don't deliberation it's worthy doubling the symptom by having to climb the aforesaid elevation for AVIF and JPEG XL. Especially erstwhile JPEG XL doesn't look to add thing to the Web platform.

3½ years ago, I said:

I want a web wherever some AVIF and JPEG XL tin exist, and developers decide which format to usage for its merits. [...] In my opinion, JPEG XL and AVIF have fundamentally different strengths which lend them to different usage cases.

At the time, JPEG XL was a overmuch stronger contender for medium-high fidelity lossy image compression. AVIF now dominates the full fidelity range, truthful JPEG XL's 1 existent advantage has disappeared.

Full Fidelity Range

JPEG XL came from Cloudinary and Google, but I deliberation the codec is discussed successful a way that doesn't make this clear. Because of the authorities astir Google's browser marketplace dominance, AV1 coming from Google, and the contention around Google's WebP, it is my sentiment that astir of the statement for JPEG XL comes from wanting a Web pinch much developer prime arsenic opposed to wanting a technologically superior image codec. I understand this, and I deliberation JPEG XL tin still thrive outside the Web successful places AVIF ne'er could. In the aforesaid article:

My existent optimistic dream is that JXL takes disconnected extracurricular the web among professionals moving pinch devices for illustration the Adobe suite aliases alternatives, and camera manufacturers, smartphone OEMs, and others return announcement and statesman to think astir JXL much seriously.

JPEG XL isn't useless; it is genuinely compelling exertion for usage cases beyond the Web. I'm conscionable not personally convinced we request it successful browsers any time soon.

Software and situation details.

More