Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: add experimental support for the JPEG-XL format, requires libvips compiled with support for libjxl, prebuilt binaries will not support this #2731

Closed
Juraj-Masiar opened this issue May 24, 2021 · 10 comments

Comments

@Juraj-Masiar
Copy link

What are you trying to achieve? -> smaller images

Have you searched for similar feature requests? -> Yes, see also #2245

What would you expect the API to look like? -> Same as other formats.

What alternatives have you considered? -> AVIF, but JPEG-XL has several advantages

Is there a sample image that helps explain? -> nope

More info:
https://jpeg.org/jpegxl/
https://bugzilla.mozilla.org/show_bug.cgi?id=1539075#c18
mozilla/standards-positions#522
https://caniuse.com/jpegxl

There is some initial implementation in Squoosh:
https://github.com/GoogleChromeLabs/squoosh

I know, it's soon, but the format spec. is finished so it's ready to be implemented. Also the comment from Facebook employee in the bugzilla thread has some good points regarding this formats (bright) future in FB.

@lovell
Copy link
Owner

lovell commented May 24, 2021

The forthcoming libvips v8.11.0 will add experimental support for this format via the libjxl reference library.

https://gitlab.com/wg1/jpeg-xl

This library is being developed in private and the commit log is mostly "Update JPEG-XL with latest changes" which makes debugging tricky, so sadly this is not quite ready for the prime time yet.

Integrating with sharp would require at least the following upstream issues to be addressed:

@lovell lovell changed the title Support for JPEX-XL format Enhancement: add support for the JPEG-XL format May 24, 2021
@veluca93
Copy link

FYI, we just migrated today to a public repo for development: https://github.com/libjxl/libjxl

@whyboris
Copy link

whyboris commented Jul 27, 2021

I'm looking forward to this feature.

I was able to get the latest version of Electron to display JPEG XL (or jxl as it's also called):

app.commandLine.appendSwitch('enable-features', 'JXL');

When sharp lets me use jxl I'll be able to better handle my image-heavy application:

https://github.com/whyboris/Video-Hub-App 🚀

JPEG XL decreases storage by 22% and "actually decodes faster than JPEG" source 🥇

Thank you for your work 🙇

@soluml
Copy link

soluml commented Jan 1, 2022

It's been awhile since the last comment, has there been any update on this?

Looks like Libvips has added support (with caveats): libvips/libvips#2181

Is there any other dependencies upstream blocking this from moving forward? Are we just needing a PR at this stage?

@lovell
Copy link
Owner

lovell commented Jan 2, 2022

@soluml Please see the list of linked issues in my comment above #2731 (comment) as these are all dependencies that must be implemented or addressed first. If you are able to help work on these in libjxl then please do so.

@soluml
Copy link

soluml commented Jan 2, 2022

Thanks for the quick reply!

On the potential DOS issue (576), that seems to be resolved per the thread.

On external LCMS2 issue (124), per the thread at the bottom, the lcms2 issue looks to be resolved: "only the vmaf part is left". So is this resolved as well?

That leaves EXIF/Metadata support (208) which looks to be on libvips if I'm following the thread correctly. It seems for most web uses, stripping exif/metadata is a good idea anyway so I don't know if an alpha implementation of JXL could be considered in the interim?

@TheJaredWilcurt
Copy link

Probably worth closing the JXL GitLab issues, and recreating them on GitHub for better tracking and prioritization. And updating the links in @lovell's comment.

@lovell
Copy link
Owner

lovell commented Dec 13, 2022

Commit a7fa701 adds experimental support for JPEG-XL when used with a globally-installed libvips compiled with support for libjxl.

Please note that the prebuilt binaries will not include support for JPEG-XL. If the situation as documented by https://caniuse.com/jpegxl changes significantly then we can revisit this.

@lovell lovell added this to the v0.31.3 milestone Dec 13, 2022
@lovell lovell changed the title Enhancement: add support for the JPEG-XL format Enhancement: add experimental support for the JPEG-XL format, requires libvips compiled with support for libjxl, prebuilt binaries will not support this Dec 13, 2022
@lovell
Copy link
Owner

lovell commented Dec 21, 2022

v0.31.3 now available with support for a globally-installed libvips compiled with support for libjxl.

If you'd like support for this in the prebuilt binaries, please direct your energy and constructive feedback towards web browser vendors rather than asking here.

@gadicc
Copy link

gadicc commented Sep 11, 2023

@lovell, thanks for your stellar work here.

Might we be able to re-visit this now that Safari includes JPEG-XL support[1]? According to BrowserStack, Safari is the 2nd most popular browser with a 24.36% market share[2]. Pre-built binaries would be immensely helpful in serverless environments where we can't install our own global binaries.

With Google it seems a bit of a chicken-or-the-egg issue; but of course, that's been discussed much elsewhere. Presumably, however, the easier it is for developers to adopt this technology, the more use we'll see. And there are some great wasm libraries to convert or render in unsupported browsers.

Thanks again for being so ahead-of-the-curve here... it was wonderful to find this issue already solved last year! 💯

[1] Version 17. Shipped on iOS; Tech Preview on Desktop.
[2] https://www.browserstack.com/guide/understanding-browser-market-share#:~:text=Overall%20Browser%20Market%20Share%202023,-Browser%20Market%20Share&text=A%20recent%20market%20study%20by,the%20remainder%20of%20the%20list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants