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

Support for Jpeg-xl #354

Open
4 tasks done
sopol1 opened this issue Apr 9, 2024 · 1 comment
Open
4 tasks done

Support for Jpeg-xl #354

sopol1 opened this issue Apr 9, 2024 · 1 comment

Comments

@sopol1
Copy link

sopol1 commented Apr 9, 2024

Acknowledgements

  • Check that there is not an existing ticket for this request, and that it is not related to an existing ticket.
  • Create one ticket per feature. Feel free to create multiple tickets.
  • If this is an extension-related request, open a ticket in the extensions repo instead.
  • Write a concise title for this ticket in the field above.

Feature details

Hi, could you add support for the recent jpeg-xl (.jxl) image format? Currently the best format supported for compression is .webp, however it is a pretty old format that is facing a rehaul with the current development of .webp2
Webp has several problems when facing shades of gray or general large tonality images as it produces several artifacts which are fixable by saving as lossless. But that causes a great increase in file sizes which is fixable with active loss option which few image encoders support and make the process more tedious, aside from the fact that saving as lossless may cause an extreme retention of details that often cause problems on rough line arts.
Jpeg-xl seem to do better and save a lot of space too. I will post a comparison with jpeg-xl on the left, webp quality 90 in the middle and webp lossless with active loss on the right, on the top you can see the file size difference.

EDIT : fixed screenshot

conversion2

Additional information (optional)

No response

@sopol1
Copy link
Author

sopol1 commented Apr 12, 2024

I made some more comparisons to stresstest jxl and webp and see how much fidelity can they retain while compressing.

Here webp manage to create artifacts/banding even when put to lossless on the far right

conversionyes2

Once again artifacts on shades of grey are certain whithout the use of lossless, which would increase the file size by a lot

conversioneyyr2

Jxl seem to do very well when compressing artificially noisy images, and generally retain noise shape better even at half the size of webp

jklcomparison

...for last i tried compressing images that showed extreme banding right from the source, since i saw some interesting options in the jxl encoder. Banding this extreme would normally be impossible to correct as it would either increase file size drastically or ruin the rest of the image, so the only chance would be to go manual and use masks. Apparently while webp don't know what to do with it, Jxl options manage to make it so subtle that it would be unnoticeable when you don't look for it.
Honestly this alone is phenomenal

conversionwo2

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

1 participant