[Lcms-user] Configuration of the bounded/unbounded mode
An ICC-based CMM for color management
Brought to you by:
mm2
From: Sergey B. <byl...@am...> - 2023-08-13 00:04:08
|
Hello, Colors Experts! I am working on the OpenJDK project and have a couple of questions about the LittleCMS library. The OpenJDK uses the LittleCMS for color conversion for a long time. And one of the use cases is getting the pixel data from the user in float format. Unfortunately before passing this float data to the LittleCMS the OpenJDK converts them to shorts(16 bit) and after color transformation converts the shorts to floats back and returns that floats to the user. The current implementation was done for LittleCMS 1 and was not updated for version 2. I have read this[1] document about the "Floating Point Encoding Range" added to the spec in 2006 and how it is implemented in the LittleCMS library and would like to use this functionality in OpenJDK. The change in OpenJDK should be straightforward, delete the intermediate conversion from floats to shorts and back and pass the floats directly to the LittleCMS library. But this is a moment I would like to clarify some possible impacts on the compatibility with the old behavior. 1. It is a good thing to do all intermediate computation in the unbounded mode during color transformation, but how the out-of-gamut values are handled for input and output data? That was not a problem for short but could be a problem for floats, for example, what will happen if 2.0f is passed as a color value for the sRGB format - will it be clipped? or error will occur? or transformation will be applied as-is? 2. What about the output? There is a cmsFLAGS_NONEGATIVES flag to prevent negative values but when and how that values will be clipped by the upper bounds? There are no options to configure that and it seems some clipping occurs here and there in the code based on some constants which are not exposed as CMS API. 3. What about the use case when the user splits the "big" transform into a few small intermediate transformations, is it possible to enable "unbounded" mode for all transformations except for the output of the latest transform? Thank you for any suggestions! [1] https://www.littlecms.com/CIC18_UnboundedCMM.pdf -- Best regards, Sergey. |