POV-Ray : Newsgroups : povray.advanced-users : Color conversion : Re: Color conversion Server Time
19 Apr 2024 15:14:42 EDT (-0400)
  Re: Color conversion  
From: Ive
Date: 10 Nov 2009 08:02:55
Message: <4af9647f$1@news.povray.org>
SharkD wrote:
> I'm converting a bunch of CIE xyY coordinates to SRGB. Obviously, most 
> (if not all) colors lies outside the SRGB gamut. However, what's the 
> best way to "fake" it?
> 
> Should I normalize each color based on the minimum and maximum of all 
> the colors? Should I simply clip values below 0 and above 1?
> 
> Mike


Your color conversion from xyY to sRGB as used within your file in 
p.b.sf is plain wrong for 3 reasons:

1.) The luminance values given in the table are obviously within a range 
of 0 to 100 (thats commonly used) but your xyY -> xyz conversion assumes 
luminance within the 0.0 to 1.0 range.

2.) For the xyY to sRGB color conversion you *NEED* also chromatic 
adaption (Bradford adaption is commonly used) because xyY uses reference 
white D50 while sRGB uses the D65 whitepoint.

3.) No gamma correction for the rgb values! Just set assumed_gamma to 
1.0 for POV version prior 3.7.


For an example how it is done right you may want to look at Jaime's
lightsysIV.
Within the file "demo_indoor2.pov" (written by me and part of lightsys) 
is the transformation from xyY to rgb used to calculate the colors for 
the GretagMacbeth(tm) Color Checker Chart.


-Ive


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.