Re: [Lcms-user] Unexpected gray to RGB result
An ICC-based CMM for color management
Brought to you by:
mm2
From: <mar...@li...> - 2022-11-27 20:23:02
|
Hello, I was puzzled because I remember I added an algorithm to detect those bad profiles and hot-fix them. Upon reviewing the code, the algorithm was there but it failed on your profile! So, you hit the rare case of gray profile + wrong V4 encoding + apparent black point higher than L* > 50 + inverted curves. All that was confusing the black point compensation part that was supposed to fix the issue. Thank you very much to help in finding a very elusive bug. Now it is fixed by https://github.com/mm2/Little-CMS/commit/caab4c07e60022a0f776b543eaa30785e2b b42ed Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Ralf Junker <ral...@gm...> Sent: Sunday, November 27, 2022 9:41 AM To: lcm...@li... Subject: Re: [Lcms-user] Unexpected gray to RGB result Thanks for the fast answer! > The embedded profile is wrong. It claims to be V4 and perceptual, but > fails to scale on perceptual black. Here is the C code that generated the profile: int main() { const cmsCIExyY *whitepoint = cmsD50_xyY(); int i; cmsUInt16Number values[256]; cmsToneCurve *tonecurve; cmsHPROFILE profile; for(i = 0; i < 256; i++) { values[i] = (255 - i) * 65535 / 255; } tonecurve = cmsBuildTabulatedToneCurve16 (0, 256, values); profile = cmsCreateGrayProfile(whitepoint, tonecurve); cmsSaveProfileToFile(profile, "gray-inverted.icc"); } The goal is a profile which swaps blacks and whites, dark grays and white grays, to create an inverted, negative grayscale. The profile's purpose is testing image rendering software with color correction using lcms2. I found WhackedRGB.icc for color images, but nothing for grayscale. > Other CMM may choose to reject the profile, lcms uses it, despite it > is wrong. My bad, I take your point. Please note that the profile somehow works with Chromium, Firefox and Gimp which all show whites on the left and blacks on the right of the image. And they all show it identically. Viewers which do not apply the profile show blacks on the left and whites on the right. > See https://color.org/specification/ICC.1-2022-05.pdf > > "6.3.4.3 PCS encodings for white and black" Unfortunately, I am unable translate this technical specification into lcms2 code. Could you suggest a function or a chapter in the documentation? I found nothing obviously related, I'm afraid. Grateful, Ralf _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |