Closed adamsilverstein closed 5 months ago
From what I can tell, this format is barely supported - could be cool to provide a sandbox for it and do some initial benchmark - couldnt tell from the trac ticket if that had indeed been done, but willing to give it a stab to see if its as good as everyone says it is!
From what I can tell, this format is barely supported
True, and it isn't even clear if this format will ever see the light of day! I opened this ticket mostly for long term tracking, I expect AVIF will be the next format we work on.
Agreed! It would be an interesting exercise to see the difference in improvement, if I get some time I will try setup a sandbox and compare JPEGXL
, AVIF
and WebP
on a WordPress site!
As it's been a while since the initial comments here at the beginning of 2022, and you probably noticed that JPEG XL has gotten really good industry and software adoption in recent months. The list here is getting pretty long. This image codec's support has spread like wildfire on Linux, all the major apps and desktops I've encountered support at least viewing (if not also encoding) those images now, it "Just Works", out of the box, and it all happened within the span of a few months... that's gotta say something, if it can offset your perception that "it isn't even clear if this format will ever see the light of day!"
I would also like to add an extra piece of information that might be relevant in making your job easier here. In addition to imagemagick already supporting it, and gd being interested in supporting this whenever possible (help wanted), I recently discovered that there is also this convenience library for PHP that would surely be relevant to WordPress: https://github.com/joppuyo/jpeg-xl-encode
WordPress has tremendous marketshare weight on the web. It would be really good if it could drive innovation forward on this front, as it has a unique opportunity to shape the web for the better. One part of the Chrome/Chromium team pretends that "the industry is not interested" in this, which makes zero sense given the current high rate of adoption and endorsement. Statements of interest in this ticket by WordPress contributors might help.
https://cloudinary.com/blog/the-case-for-jpeg-xl is also a very good read in response to what has been observed in that ticket, and so is https://jpegxl.info/why-jxl.html as a shorter "features-centric" read.
While I am a JPEG XL proponent, I don't really think it makes much sense to add JPEG XL support to WordPress until the format support has been added to browsers. The only browser that supports JPEG XL today is Pale Moon which has a negligible market share. Why should we generate images when barely no browser will be able to display them?
Furhermore, the multi-format image support in WordPress is currently a mess. Since there's no picture tag support, WordPress core developers have been coming up with all kinds of hacks when implementing WebP support for unsupported browsers, including rewriting image tags using JavaScript or using a JavaScript polyfill for converting WebP images to JPEG in the browser.
I think adding JPEG XL or even AVIF support can't be done properly until proper picture tag support has been added to WordPress.
I appreciate linking my library for converting JPEG and PNG images to JPEG XL, but I don't think running the cjxl binary on the command line is a good solution for the general public. WordPress image processing traditionally uses ImageMagick or GD and while ImageMagick has added JPEG XL support already, it has not landed yet in GD.
Like WebP support right now, JPEG XL support will depend on the build flags used when building ImageMagick and GD. So we also need to wait until operating systems and web hosting companies start shipping JPEG XL support so it becomes mainstream.
I agree with @joppuyo ... adding support for this format to the performance lab is premature. https://caniuse.com/jpegxl
I should think a standalone plugin would be a good way to proceed in late 2022. When and if browser support becomes widespread then the decision can be revisited.
While I am a JPEG XL proponent, I don't really think it makes much sense to add JPEG XL support to WordPress until the format support has been added to browsers.
@joppuyo And Chromium claims, that it wont add support until JPEG XL becomes more adopted in web ecosystem (that includes Wordpress). How do you propose we should get out of this paradoxical situation?
A claims they wont add JPEG XL until B does. B claims they wont add JPEG XL until A does.
Seems like Catch-22.
latest news: Safari 17 Beta has JPEG XL support
JPEG XL (0.03% browsers support) seems essentially dead. AVIF (85% browsers support) has won the race and any efforts ought to be focused on AVIF.
It is currently at 0.03% since there are few users who are on the beta version of Safari.
However, when JXL support is enabled in the stable version, the percentage will go up to ~20% eventually (according to Statcounter's Browser Market Share Worldwide - June 2023, Safari has 20.5% of market share).
Given that Apple added JXL support even after Google Chrome has removed it, it seems rather early to say "JPEG XL seems essentially dead".
Uhm, where is the problem for WordPress considering that it is possible to deliver a JPG out of a JXL to clients that don't support JXL yet?
Closing as maybelater, like the Trac ticket.
While JPEG XL is not dead or anything, the current browser support status is not enough for WordPress core to consider adding support, and even not worth the effort to add something to the Modern Image Formats plugin.
Trac ticket: https://core.trac.wordpress.org/ticket/52788