Make WordPress Core

Opened 9 months ago

Last modified 7 months ago

#52788 assigned feature request

Add JPEG XL support.

Reported by: atjn Owned by: adamsilverstein
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: performance Cc:


JPEG XL is a new image format that beats JPEG, PNG, WebP and AVIF in pretty much all categories. I believe it will be widely used on the internet in a few years.

Cloudinary has made an awesome overview that shows why JPEG XL is better than anything else. Please note that they helped make the format, so they could be biased, but I haven't found any issues with it.

First and foremost it would be great to support uploading it to media, but down the line I think it could be used for much more. Thumbnails of any other image type could be generated in JPEG XL, greatly improving performance. It might even make sense to support delivering any source image as a JPEG XL, no matter the original encoding.

Here are a few points I think are especially nice for WordPress:

  • Encoding speed is better than WebP and AVIF, so there's no risk that users would have to upgrade their server to use it.
  • It supports progressive decode which is huge for perceived performance, and could theoretically allow you to only produce one large thumbnail and then just not load the entire image when you need a smaller preview.
  • It is expected to be widely supported, meaning users can use it as their main local editing format, they can download and directly view the images, and it will work in all browsers. This is not the case for WebP and AVIF, which has caused a lot of frustration among developers and end-users.

JPEG XL is, as of writing, not supported in any browsers, but will almost certainly be soon. Chromium has marked it as their highest priority. You can see the current status here: caniuse.com/jpegxl

The official JPEG XL page is here: jpeg.org/jpegxl
A free and open source encoder/decoder is in the works: gitlab.com/wg1/jpeg-xl

Change History (6)

#1 @adamsilverstein
9 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to adamsilverstein
  • Status changed from new to assigned

#2 @atjn
9 months ago

If you want to play around with it, I can recommend Squoosh. Just remember that the encoder is in early beta, so it will be slower and produce larger files than it should do.

#3 follow-up: @spacedmonkey
8 months ago

Having a quick look into this, it seems like neither of the imagick or gd support this codex. So until they support it, feels like it unlikely core can.

#4 in reply to: ↑ 3 @atjn
8 months ago

Replying to spacedmonkey

Good point! As far as I can tell, it is already supported in imagick: https://imagemagick.org/script/formats.php#supported

If JPEG XL becomes widely supported in browsers, I would expect GD to add support, the same way they have done with WebP and AVIF.

#5 @atjn
7 months ago

You can now enable experimental JPEG XL support in Chrome, Edge, and Firefox: https://caniuse.com/jpegxl

#6 @adamsilverstein
7 months ago

Noting that JPEGXL support is being proposed for libgd in https://github.com/libgd/libgd/issues/699.

Note: See TracTickets for help on using tickets.