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: Tom L. <to...@ke...> - 2024-01-30 00:09:07
|
<div dir='auto'><div dir="auto">On 29 Jan 2024 21:33, Adrian Knagg-Baugh <aje...@gm...> wrote:<br></div><div><div class="elided-text"><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>I have extracted the chromaticity xy coordinates from a cmsHPROFILE as follows:</div><div><br> cmsCIEXYZ *red;<br> cmsCIEXYZ *green;<br> cmsCIEXYZ *blue;<br> red = cmsReadTag (profile, cmsSigRedColorantTag);<br> green = cmsReadTag (profile, cmsSigGreenColorantTag);<br> blue = cmsReadTag (profile, cmsSigBlueColorantTag);<br></div><div></div> cmsXYZ2xyY(&redxyY, &red);<br> cmsXYZ2xyY(&greenxyY, &green);<br><div> cmsXYZ2xyY(&bluexyY, &blue);</div><div><br></div><div>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:<br></div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb( 0 , 0 , 0 );background-color:rgb( 255 , 255 , 255 )">redxyY x: 0.648438, y: 0.330868, Y: 0.222488 </span><br>greenxyY x: 0.321176, y: 0.597877, Y: 0.716904 <br>bluexyY x: 0.155899, y: 0.066051, Y: 0.060608 <br></span></div><div><span style="font-family:'arial' , sans-serif"><br></span></div><div><span style="font-family:'arial' , sans-serif">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?<br></span></div><div><span style="font-family:'arial' , sans-serif"><br></span></div><div><span style="font-family:'arial' , sans-serif">Thanks,</span></div><div><span style="font-family:'arial' , sans-serif"><br></span></div><div><span style="font-family:'arial' , sans-serif">Adrian.<br></span></div><br></div> </blockquote></div><br></div><div dir="auto">Adrian,</div><div dir="auto"><br></div><div dir="auto">red, green and blue are already pointers, so you shouldn't be taking their address.<div dir="auto"><br></div><div dir="auto">i.e. remove the &s</div><div dir="auto"><br></div><div dir="auto">Surprised your compiler didn't warn about this?</div><div dir="auto"><br></div><div dir="auto">Cheers</div></div></div> |