Re: [Lcms-user] Need help recovering the chromaticities that a profile was made with
An ICC-based CMM for color management
Brought to you by:
mm2
From: Adrian Knagg-B. <aje...@gm...> - 2024-01-29 22:07:39
|
Thank you for the explanation. Yes, that's great, I will create a transform from profile to XYZ, use it to transform each RGB primary using absolute colorimetric, and then convert to xyY straightforwardly. Thanks again, Adrian. On Mon, 29 Jan 2024, 22:02 , <mar...@li...> wrote: > Hello, > > > > > is there something I'm not accounting for? And is there a more correct > way to read the original chromaticities back out of a profile? > > > > You are assuming the internals of ICC profiles works in a way they don’t. > The cmsSigXXXColorantTag tags does NOT contain direct information on the > primaries, numbers are “cooked” and it is certainly possible for those tags > to be missing on some profiles. > > > > You should avoid reading tags directly as much as possible. Instead, use > an absolute colorimetric transform with no observer adaptation to get the > primaries. This would work no matter which profile type are you using. > > > > Here an example by using the transicc tool, you can do the same creating a > transform with absolute colorimetric intent making sure to set the observer > adaptation state to 0 first. I am trying to recover sRGB red primary: > > > > marti@I7:~$ transicc -t3 -d0 -i*sRGB -o*XYZ > > LittleCMS ColorSpace conversion calculator - 5.1 [LittleCMS 2.16] > > Copyright (c) 1998-2023 Marti Maria Saguer. See COPYING file for details. > > > > Enter values, 'q' to quit > > R? 255 > > G? 0 > > B? 0 > > > > X=41.2391 Y=21.2639 Z=1.9331 > > > > You convert this XYZ of (41.2391, 21.2639, 1.9331) to xyY, for example > using this link: http://www.brucelindbloom.com/ColorCalculator.html > > > > xyY = (0.6400, 0.3300, 21.2639) Which corresponds to the Rec709 > chromaticity of red. > > > > Hope that helps > > > > Marti Maria > > The LittleCMS Project > > https://www.littlecms.com > > > > > > > > > > *From:* Adrian Knagg-Baugh <aje...@gm...> > *Sent:* Monday, January 29, 2024 10:34 PM > *To:* lcm...@li... > *Subject:* [Lcms-user] Need help recovering the chromaticities that a > profile was made with > > > > Hi, > > > > I have extracted the chromaticity xy coordinates from a cmsHPROFILE as > follows: > > > cmsCIEXYZ *red; > cmsCIEXYZ *green; > cmsCIEXYZ *blue; > red = cmsReadTag (profile, cmsSigRedColorantTag); > green = cmsReadTag (profile, cmsSigGreenColorantTag); > blue = cmsReadTag (profile, cmsSigBlueColorantTag); > > cmsXYZ2xyY(&redxyY, &red); > cmsXYZ2xyY(&greenxyY, &green); > > cmsXYZ2xyY(&bluexyY, &blue); > > > > However, if the profile I do this to is a sRGB profile made with > chromaticities from the cmsCIExyYTRIPLE {{0.639998686, 0.330010138, 1.0}, > {0.300003784, 0.600003357, 1.0}, {0.150002046, 0.059997204, 1.0}}, and the > standard sRGB whitepoint cmsCIExyY d65_srgb_adobe_specs = {0.3127, 0.3290, > 1.0}; I don't get back the same coordinates. Instead I get: > > > > redxyY x: 0.648438, y: 0.330868, Y: 0.222488 > greenxyY x: 0.321176, y: 0.597877, Y: 0.716904 > bluexyY x: 0.155899, y: 0.066051, Y: 0.060608 > > > > What's going on here: is there something I'm not accounting for? And is > there a more correct way to read the original chromaticities back out of a > profile? > > > > Thanks, > > > > Adrian. > > > |