Hi Marcus,
The formula you pulled out of the archive, which was a reply by Raphael, is correct. I don't know why you expect a color with an (x,y) of (.3304,.3582) to be more red than green, since (.3333,.3333) is neutral and you have slightly decreased red and increased green. A slight green is what I would expect to see, not a slight yellow.
I'm not sure where the slight difference between the color you obtain with the Radiance matrix and the one you obtained from the tutorial arose, but the first matrix you have below is the correct one.
There are subtle issues having to do with white point as well, which you may not be taking into account.
-Greg
ยทยทยท
From: "Marcus Jacobs" <[email protected]>
Date: October 18, 2005 12:04:52 PM PDTDear Group
I have come across an issue regarding converting colors from CIE xyY color space to Radiance's rgb. From the post:
http://www.radiance-online.org/pipermail/radiance-general/2005-June/002783.html
and from RWR, the conversion is as follows:
X=x*Y/y;
Z=(1-x-y)*Y/y;
r= 2.565*X -1.167*Y -0.398*Z;
g= -1.022*X +1.978*Y +0.044*Z;
b= 0.075*X -0.252*Y +1.177*Z;However, when I attempt a conversion the color seems way off. For example, the color x = 0.3304 , y = 0.3582 , Y = 0.9822 which I expect to be a faint yellow converts to rgb = 0.838, 1.05, 0.825, which is more of a faint green. I have used another script found in the following paper:
http://aesl.hanyang.ac.kr/resource/radiance/rstds.pdf
The rgb.cal script in this paper list the following for xyY to rgb conversion:
X=x*Y/y;
Z=(1-x-y)*Y/y;
r= 2.739*X -1.145*Y -0.424*Z;
g= -1.119*X +2.029*Y +0.033*Z;
b= 0.138*X -0.333*Y +1.105*Z;Although not always spot on, its much closer to the aforementioned (the previous example converts to rgb = 0.995,1.01,0.74 which is a faint yellow with a slight green tint). Thanks for any help and/or advice. As a note I should mention that I use the following online calculator to convert from 0-255 rgb color space to CIE xyY color space:
http://www.easyrgb.com/calculator.php
Regards,
Marcus