-
-
Notifications
You must be signed in to change notification settings - Fork 700
Improve scRGB support #3623
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
Improve scRGB support #3623
Conversation
When converting scRGB to and from sRGB, the image gamma changes. This breaks all ICC profiles causing a range of problems downstream. This patch removes any profile on sRGB <-> scRGB conversion. See #3621
... since RGB16 also has a gamma
Issue #2858 and its test case may also be relevant here. |
The test case in #2858 works with this PR:
|
libvips/libvips/foreign/jxlsave.c Lines 526 to 528 in 74adb39
Changing that to
|
Ah, the |
Ugh, this will take a while. We should get #3712 in at the same time. Shall we park this for 8.16? It would delay release by quite a while. |
I had a very quick attempt with commit kleisauke@d7daf54, and it appears to work; however, jxlload is unable to decode these images due to: To decode these extra channels, you apparently also need to call |
I think this PR would still be useful to have for 8.15. How about this commit?: That would mimic
On a somewhat tangent, it seems that the new streaming encode API in libjxl uses a callback-based approach, rather than a 'push'-based tile/scanline approach (used in libraries like libtiff). |
OK, let's do that, and I suppose leave the jxl load / save reworking for 8.16? |
Indeed, let's defer the jxl load/save rework to the 8.16 cycle. |
Handling of scRGB has a couple of issues:
When converting scRGB to and from sRGB and RGB16 we are changing the image gamma, so any profiles on the image will break. They need to be removed.
Conversion for saveable RGB did not handle scRGB
See #3621
Using the test image from the linked issue (a float TIFF saved by photoshop) with this PR I can now run:
To make:
Though this makes a black image:
So I suppose
icc_transform
does not handle scRGB correctly. I'll mark this as a draft until this extra issue is resolved too.