I'm going to assume all you know about your two spaces comes from the two profiles you have:

You can get the primaries from each profile (I've never looked into CMYK profiles but I would image they would contain them), and just do a simple inside/outside test for the triangle between the three points. This would be a bit of a hack but probably a pretty good indicator.

To convert your RGB value to an x,y chromaticity might be a little tricky using just lcms. You'd essentially want a destination profile of CIE's XYZ space. Once you have an XYZ coordinate the chromaticities are just:

x = X/(X+Y+Z)
y = Y(X+Y+Z)

Now you can just see if they are inside the triangle of the CMY coords (you can safely forget about black's color). I've never seen a XYZ profile though. If you made a profile with the same primaries as your rgb space but with a linear gamma you could convert to that first and then I think (someone correct me if I'm wrong here) the XYZ of that rgb would just be the sum of the relative amounts of each primary your linear rgb value has. So to recap, transform your orignal rgb into a linear gamma space (still RGB). Multiply your red primary's XYZ coord by the red component (an 8 bit code of 128 would be 0.5 remember), do the same for green and blue and then sum the three XYZ's. You can then plug that into the above eqn to get x,y


Another possibility (another hack) is that if your profiles happen to support "absolute colorimetric" intent (I think that's the one that tyries to match chroma no matter what) then all you need do is do a round trip conversion. If you get back to roughly where you started then you are probably in gamut. This is probably more of a hack than my first suggestion.



Good luck!



On Friday, April 4, 2003, at 12:07 AM, muhammad ahmed wrote:


Hi :
Can any one please help me how to find whether a
particular color value in RGB is out of cmyk-gamut
for example in photoshop the color picker gives
warning for some specific rgb colors
eg (R,G,B)(0,255,100) is out of gamut.

i would be gratefull,if any one can help me from
programing point of view
Thanks
Ahmed

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com


------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ Lcms-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/lcms-user



-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Lcms-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to