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

icc support #131

Open
JohannesBeranek opened this issue Jun 9, 2022 · 5 comments
Open

icc support #131

JohannesBeranek opened this issue Jun 9, 2022 · 5 comments

Comments

@JohannesBeranek
Copy link

JohannesBeranek commented Jun 9, 2022

See e.g. https://cameratico.com/tools/web-browser-color-management-test/ for test content

Wasn't able to correctly resize a non sRGB image with an embedded color profile. Unfortunately I can't post that specific image here.

"linear" resizing is possible by manually changing the colourspace beforehand and after resizing, but I can't seem to get jvips to load the embedded profile and apply it correctly.

Also note https://github.com/libvips/libvips/wiki/HOWTO----Image-shrinking
as well as https://www.libvips.org/API/current/Using-vipsthumbnail.md.html (part "Colour Management")

@JohannesBeranek
Copy link
Author

JohannesBeranek commented Jun 9, 2022

My preference would be

  • add linear boolean flag to thumbnail methods
  • add vips_icc_import in case image is not resized but e.g. autorotated

With what is mentioned here https://www.libvips.org/API/current/Using-vipsthumbnail.md.html under "Colour Management" it should be possible to accomplish this, including stripping the colour profile and still get a correct sRGB image

@JohannesBeranek
Copy link
Author

JohannesBeranek commented Jul 15, 2022

Is there anything I can do to get this working @dbouron ?

@JohannesBeranek
Copy link
Author

Actually, this might be (partly) resolved if you add the remaining parameters to the thumbnail method
That way it would be possible to create all the needed crop/inside fill/outside fit/exact fit thumbnails and use linear light resizing if needed. As far as I got it vips_thumbnail should just handle all those colorspace and color profile conversions correctly out of the box

@dbouron
Copy link
Contributor

dbouron commented Aug 9, 2022

Hi,
I will have a look at the end of august. I haven't my workstation at this moment

@JohannesBeranek
Copy link
Author

@dbouron thanks! We've sinced forked https://github.com/cactuslab/JVips (and added a few fixes) though which provides all those features as well as a closer-to-libvips interfaces, so from my end this is a non issue now. Works with that code if I use the thumbnail method and afterwards just call

		image.applyIccTransform("srgb", new ICCTransformOptions().embedded(true).inputProfile("srgb"));

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

No branches or pull requests

2 participants