JVips
JVips copied to clipboard
icc support
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")
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
Is there anything I can do to get this working @dbouron ?
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
Hi, I will have a look at the end of august. I haven't my workstation at this moment
@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"));