JVips icon indicating copy to clipboard operation
JVips copied to clipboard

icc support

Open JohannesBeranek opened this issue 2 years ago • 5 comments

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 avatar Jun 09 '22 13:06 JohannesBeranek

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 avatar Jun 09 '22 13:06 JohannesBeranek

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

JohannesBeranek avatar Jul 15 '22 08:07 JohannesBeranek

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

JohannesBeranek avatar Jul 15 '22 13:07 JohannesBeranek

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

dbouron avatar Aug 09 '22 19:08 dbouron

@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"));

JohannesBeranek avatar Aug 10 '22 11:08 JohannesBeranek