-
-
Notifications
You must be signed in to change notification settings - Fork 698
Add linear color encoding for JXL save operation #2568
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
Comments
Also it seems libjxl now has JxlEncoderSetICCProfile() method, so it can be used instead of the logic above when input files have a profile. As I can see currently ICC profiles are not handled for JXL. |
Hi @f1ac, Sure, this all sounds good. Let's tag this as an enhancement for 8.13. |
OK, done! I've made a PR here: Any testing very welcome. It looks like libjxl now has EXIF, XMP etc. as well, so we should also add support for them, and perhaps bump the minimum supprted libjxl version. |
@jcupitt Are there any nightly builds for windows? I gave up trying to compile the library, so can't test this w/o binaries unfortunately. |
With WSL2 it should be a one-liner to build from source now: https://github.com/libvips/build-win64-mxe Just:
To build git master libvips for windows. It does take a while :( |
Of course, having looked at this, there's no simple way to build a specific commit. I'll try to add this feature. |
I've managed to build vips master, then changed the branch in plugins/nightly/overrides.mk to "vips-all_GH_CONF := libvips/libvips/branches/add-more-libjxl-metadata". The second time it was much faster, but I guess it did not pick up the new branch as resulting JXL files are identical to the ones converted with v8.12.2. I either need to clean up build folder or the overrides do no work. |
If you want to test specific commits or branches, I think you also need to change nightly_version=$(wget -q -O- 'https://api.github.com/repos/libvips/libvips/git/refs/heads/add-more-libjxl-metadata' | sed -n 's#.*"sha": "\([^"]\{7\}\).*#\1#p' | head -1) (to test the or just: nightly_version="bb8d107445759cb5db2c15bd5ea3335905a2e817" (to test commit bb8d107) I'll try to add support for the |
I posted a sample output image in linear space here: #2815 (comment) There's an ICC profile too. |
@jcupitt GIMP shows both jpg and jxl do not have embedded ICC, jpeg has EXIF data. |
Sorry! I messed up. Let me try again. |
* add ICC and scRGB support see #2568 * final polish
Currently JxlColorEncodingSetToSRGB() is always used in jxlsave.c, but it seems calling JxlColorEncodingSetToLinearSRGB() would be more appropriate when input image has VIPS_FORMAT_FLOAT and/or VIPS_INTERPRETATION_scRGB. Currently exported linear images appear as if they have additional gamma of 2.2 applied to them because of this issue.
Libjxl tests seem to follow this logic (float input means linear output when input file has no ICC profile) at https://github.com/libjxl/libjxl/blob/main/lib/jxl/roundtrip_test.cc
The text was updated successfully, but these errors were encountered: