Repository navigation
Description
Claude reworked this description around Jake Archibald's JXL vs AVIF research and the current state of #77584:
Overview
Add JPEG XL (JXL) support to client-side media processing. This was requested in #76756 by several community members.
The work is in #77584, with the server-side core backport in WordPress/wordpress-develop#12006.
What JXL offers, and what it doesn't
Jake Archibald compared JXL and AVIF for web use in https://jakearchibald.com/2026/jpeg-xl-vs-avif/ (October 2026, avifenc 1.4.2, libjxl 0.12.0 and the newer jixel encoder, scored with SSIMULACRA 2 and ColorVideoVDP). The headlines that matter for WordPress:
Where AVIF is better:
- Lossy photos: the best JXL is typically 15-25% larger than the equivalent AVIF at default efforts, and 6-20% larger at maximum efforts. There are outliers where JXL wins, so it is not every image.
- Screenshots and illustrations: JXL is 30-90% larger at default efforts.
- Transparency: libjxl is 31-44% larger at default efforts.
- Speed and memory: AVIF is generally faster to encode for the file size it produces, uses less memory, and decodes faster. JXL typically takes 2-3x as long to decode at medium quality.
- HDR gain maps: the JXL format supports them, but no browser decodes them. Without gain maps the two metrics disagree a lot, though both put PQ JXL smaller than PQ AVIF.
Where JXL is better:
- Lossless JPEG recompression: JXL can make existing JPEGs 9-20% smaller without further loss, and they decode as fast or faster (except small images). Add JPEG XL support #77584 does not use this - transcoding a JPEG to JXL in the upload pipeline decodes and re-encodes, so it is lossy.
- Lossless images: JXL is the clear winner, though lossless is rarely what the web needs.
- Progressive decoding: cheap with libjxl, and supported in Chrome and Firefox (Safari shows only the final image).
Two findings bear directly on the settings in #77584:
- libjxl's higher efforts are much slower and barely improve the result, so the PR's effort 3 (chosen because libvips' default of 7 is too slow to wait on in the editor) should not give up much against higher efforts. It does sit below libjxl's default, so expect JXL output from the PR to land at or past the larger end of the gaps above.
- Jake's own conclusion is to default to AVIF, and try JXL when AVIF produces an unusually large file.
A smaller check with WordPress's own settings agrees on the big picture. Encoding the 37 reference images from the AVIF quality benchmark (https://github.com/b1ink0/avif-quality-benchmark) with libjxl at effort 3 and quality 82, JXL scored about the same as JPEG 82 on SSIMULACRA 2 (median 78.8 vs 78.5) at 73% of the JPEG size. So JXL is a real improvement over JPEG at the WordPress default quality. Against the browser's AVIF at matched quality, photos came out closer to a tie than Jake found, and AVIF was again much smaller on diagrams and screenshots.
So the case for JXL in WordPress is not smaller files than AVIF. It is that browsers now display JXL, so sites and photographers that already work in JXL can upload it and get JXL sub-sizes, and that JXL is a clear step up from JPEG for anyone who picks it as an output format.
Browser support
Per https://caniuse.com/jpegxl (checked 2026-10-23):
- Chrome: on by default since 155 (Chrome for Android since 156). 145 to 154 had it behind a flag.
- Firefox: on by default since 158, desktop and Android.
- Safari: partial support since 17, macOS and iOS.
- Edge, Samsung Internet, Opera: not yet.
caniuse puts global support at roughly 60%. A JXL attachment has no fallback format, so visitors on an unsupported browser will not see the image. That is the main trade-off.
How #77584 works
- JXL stays JXL. A
.jxlupload is handled like a WebP or AVIF: the.jxlis the attachment, and its sub-sizes are generated as JXL in the browser with vips and sideloaded. It is no longer converted to JPEG the way HEIC is.- HDR originals kept as uploaded. 16-bit HDR and gain-map JXL uploads are stored byte for byte (covered by e2e tests), though browsers do not apply JXL gain maps yet.
- JXL as an output format. A JPEG, PNG or WebP upload can be transcoded to JXL through
image_editor_output_format.- Lazy-loaded decoder.
vips-jxl.wasmships as its own script module chunk (~850 kB gzipped) that the browser only fetches the first time a JXL is processed. Sessions that never touch JXL download nothing extra; the always-loaded cost is under 1 kB. This replaces the canonical plugin approach in Client-side media: Add JPEG XL (JXL) support via canonical plugin #76990, which put an install step in front of JXL and left non-admins without it, and the bundled approach in Client-side media: Bundle JPEG XL (JXL) support directly into Gutenberg #77570, which added the decoder to every editor load.- Server side.
image/jxlis added toupload_mimes(the network's upload file types still decide whether it is allowed), awp_check_filetype_and_extfilter sniffs the JXL magic bytes since fileinfo reportsimage/x-jxl, and a small header parser reads the width and height becausegetimagesize()cannot read JXL. The attachment metadata and the sideload endpoint use those dimensions.Tasks
- Lazy-load
vips-jxl.wasmon first JXL use- Add
image/jxltoCLIENT_SIDE_SUPPORTED_MIME_TYPESand JXL to the output formats- Keep JXL uploads and sub-sizes as JXL
- Register
image/jxlserver side and read JXL dimensions without GD or Imagick support- Unit, PHPUnit and e2e tests
- Merge Add JPEG XL support #77584 (paused until browser support is wide enough)
- Land the core backport, Media: Add JPEG XL (JXL) upload support (backport GB #77584) wordpress-develop#12006 (Trac: https://core.trac.wordpress.org/ticket/52788)
Open questions
- How much browser support is enough to ship a format with no fallback? Edge is the largest holdout.
- Is lossless JPEG recompression worth a follow up, as an opt-in for sites that upload a lot of JPEGs? It is the one place JXL clearly beats every other option for existing content.
- When JXL is the output format, the full-size file stays in its original format (the same as for every other output format in client-side processing), and only the sub-sizes become JXL. Should converting the main file be a follow up for all formats?
Related
- Client Side Media iteration for WordPress 7.1 #76756 - Client-side media iteration for WordPress 7.1
- Build: Remove unused JXL WASM module from vips worker #76639 - Build: Remove unused JXL WASM module from vips worker
- Client-side media: Add JPEG XL (JXL) support via canonical plugin #76990 - JXL via canonical plugin (closed)
- Client-side media: Bundle JPEG XL (JXL) support directly into Gutenberg #77570 - JXL bundled into the vips worker (closed)
- Media: Add HEIC canvas fallback for client-side processing #76732 - HEIC canvas fallback for client-side processing
- https://jakearchibald.com/2026/jpeg-xl-vs-avif/ - JPEG XL vs AVIF for web use-cases
- AVIF sub-sizes are larger than WebP at the default quality of 82 performance#2745 - AVIF quality default discussion
AI Use
Description written with 🤖 Claude Code, summarizing Jake Archibald's research plus a smaller check with WordPress's settings.
Activity
Add JPEG XL (JXL) support via canonical plugin pattern
[-]Client Side Media: Add JPEG XL (JXL) support[/-][+]Add JPEG XL (JXL) support[/+]BlackStar1991 commentedon Apr 11, 2026
No one exept Safary support JXL . Very raw technology for 2026
adamsilverstein commentedon Apr 11, 2026
Good point. That's why we plan to only load the support for jxl when a user needs it, ie when they first try uploading one.
adamsilverstein commentedon Jun 24, 2026
Noting that we plan to hold off on landing JXL support for now and I have switched the PR to draft accordingly. I'm also removing this ticket from the 7.1 board and 7.1 iteration stack. The PR is still available for testing: #77584
11 remaining items
nickchomey commentedon Oct 27, 2026
Im also quite curious to see cpu and ram performance. It's a significantly smaller bundle too.
I don't see why not. It's just JS.
My point was that this is JS-only, so seemingly all browsers could use it (unless it uses any apis that are not yet universal).
adamsilverstein commentedon Oct 27, 2026
@nickchomey I ran some numbers comparing rapier-jxl to the vips approach in #77584. Short version: it doesn't look like a better fit for us right now, mostly because it is encoder only.
Claude ran the benchmarks and wrote up what it found:
Unless rapier gets a lot faster at its higher efforts, I'm inclined to stick with vips for now especially since we already use it. Running the code in WASM has some structural advantages as well.
nickchomey commentedon Oct 27, 2026
That all makes sense. I agree. Thanks for checking it out!
jackskip22 commentedon Oct 28, 2026
Thanks for trying rapier-jxl! I just pushed 7.0 which is much better for upload queues and finalizes the API. In Chrome, encoding WordPress uploads at the same quality as vips Q82 effort 3 takes about 0.4x the time with about 2% smaller files. I’m working on more optimizations for 7.0.1 now. Opt-in acceleration runs heavy work in WebAssembly SIMD with a plain JavaScript fallback and it doesn’t need SharedArrayBuffer.
For your PR, vips would keep resizing, rapier-jxl does JXL encoding and the browser decodes JXL uploads. Then JXL uploads after the first one finish in about 0.7x the time in your queue. 7.0 also has a fallback decoder for Edge, Playwright’s Chromium and older browsers. Its JXL code including the decoder is under 200 KB gzipped vs. about 850 KB for the vips JXL module.
When I was testing, wasm-vips 0.0.19 couldn’t open JXL files with Brotli-compressed XMP which cjxl writes by default. But Chrome and djxl can open them fine.
Feel free to reach out with any requests. I’m working on tuning each effort level for different use cases.
nickchomey commentedon Oct 28, 2026
@jackskip22 can I suggest releases, tags or at least a changelog? It would be useful to seeing changes across versions (as well as even noticing that there are new versions)
Edit: I now see that it is evolving very quickly - 3 major versions in a week! Still, it would be useful to note the major changes per version - so we can learn what you've learned, and see how it affects the api etc
jackskip22 commentedon Oct 28, 2026
On it! v7 is the first release in the permanent shape after much experimentation - I'll make it easier to follow now. Will push 7.0.1 later with changelog, tags and releases
adamsilverstein commentedon Oct 28, 2026
@jackskip22 thanks for stopping by and for the updates!
We aren't quite ready to merge JXL support so I will continue to monitor your effort and compare it to the vips alternative for our needs.
nekohayo commentedon Nov 23, 2026
For the record, as mentioned in WordPress/performance#12 (comment) :
On the desktop, Edge has about 13% marketshare according to https://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-202001-202611, but it's the only holdout that is not entirely negligible.
On mobile, Chrome + Safari (+ Firefox) together hold over 92% marketshare according to https://gs.statcounter.com/browser-market-share/mobile/worldwide#monthly-202001-202611
Maybe you (Wordpress) signalling your intent to ship JPEG XL (at least as a beta feature), given your heavy influence on the web, would be something you could bring up in a conversation with Microsoft (certainly at least someone in your organization has some contacts over there) to motivate them to ship it in Edge faster.
adamsilverstein commentedon Nov 23, 2026
Thanks for the update @nekohayo - great to see the growing support. Any idea why Edge is holding out on JXL support?
If you want to give the PR a test, your feedback would be helpful: #77584 (click the Playground link in the description to run the PR in your browser and try uploading and using a JXL)
nickchomey commentedon Nov 23, 2026
I couldn't find anything about edge holding out. Here's their issue tracker item.
https://feedbackportal.microsoft.com/feedback/idea/5995d056-50b6-f011-aa44-7c1e5298a4a1
jackskip22 commentedon Nov 23, 2026
I think the main barriers for JXL adoption are device support and nobody knowing about it. Automatic fallbacks are easy on the web. Sub-sizes can keep JPEG or WebP copies with each JXL, or sites that only want to store JXL can use a WebAssembly decoder to show JXL images in Edge and older browsers, like JPEG XL polyfill.
Windows has Microsoft's JPEG XL Image Extension and Apple devices already support viewing JXL images. But Android's Gallery and Google Photos do not support it yet. Animated JXL is becoming popular to save storage space on GIFs but Safari doesn't play animated JXL yet, so apps and sites need animated PNG or animated WebP fallbacks for now.
adamsilverstein commentedon Nov 23, 2026
Fallbacks may be technically easy, but they are difficult to understand for average users. When users upload images to their website, they just want them to work - they don't care about the underly "codec" - they might care about the image quality or whether their full HDR image is displaying properly. Image formats though are an implementation detail only technologists like ourselves really care about.
Even when we reach the point that all web browsers support a given format (eg. WebP), there can still be considerable friction to user adoption: for example, you may be unable to share a WebP image you download from a website in a Google Doc (Docs doesn't support webp), or it might not show up in your social feeds (facebook doesn't support webp images in the Open Graph tag).
All that said, once JXL support ships in Edge, we will have met all the requirements for WordPress to ship support here.
wadetregaskis commentedon Nov 23, 2026
Could JPEG XL support be added in "preview" now, until Edge catches up?
It's no big issue to me if I have to turn JPEG XL on in the WordPress settings. It's significantly more irritating - and error-prone - if I have to write a custom plug-in to do it. Which I've done, now, but others could be saved the hassle.
(and I had to do the same thing for AVIF not that long ago, so I'm vaguely familiar with the process - most people aren't)
FWIW in my experiments so far with JPEG XL it offers only similar compression efficiency to AVIF on average (but notably better for lossless and 'graphics' like screenshots) but with the big advantage that it's up to an order of magnitude faster at encoding. To me that's important - end-users aren't likely to sit there for several minutes waiting for an AVIF encode, but they might tolerate ten seconds for a JPEG XL encode, that yields essentially the same effect. It'll also help with thumbnail generation etc, in making WordPress a bit more responsive.
adamsilverstein commentedon Nov 23, 2026
The only real mechanism we have for this is Gutenberg Experiments, which is more for testing new proposed features.
I'm hopeful Edge support will catch up soon and WordPress will decide to add support, for now a plugin is still the best route.
nickchomey commentedon Nov 23, 2026
I asked someone on the Edge team and all he said was that there's an issue with patent trolls. Unfortunate to hear, but I suspect we won't get more information about it due to legal proceedings. A few articles i found:
https://www.theregister.com/software/2021/03/13/third-times-a-harm-microsoft-tries-to-get-twice-rejected-encoding-patent-past-skeptical-examiners/408210
https://www.theregister.com/software/2022/02/17/alarm-raised-after-microsoft-wins-data-encoding-patent/394460
https://www.theregister.com/software/2023/06/07/apple-adds-support-for-google-shunned-jpeg-xl-in-safari/1071614