[Radiance-general] CIE Color Conversion

Gregory J. Ward gregoryjward at gmail.com
Fri Jun 24 10:16:57 CEST 2005


Hi Marcus,

To get RGB values from CIE Yxy input, you need an additional  
conversion from Yxy to XYZ, i.e.:

     X = Y*x/y;
     { Y = Y; }
     Z = Y*(1 - x - y)/y;

This can go inline with xyz_rgb.cal like so:

rcalc -e 'Y_i=$1;x_i=$2;y_i=$3' -e 'X_i=Y_i*x_i/y_i;Z_i=Y_i*(1-x_i- 
y_i)/y_i' -f xyz_rgb.cal

If you give Y x y on input, you'll get RGB on output.  (You can use a  
Y of 1 if you like.)

-Greg

> From: "Marcus Jacobs" <marcdevon at hotmail.com>
> Date: June 23, 2005 8:20:24 PM BDT
>
> Hi All
>
> I have a question about using the existing utilities for converting  
> a CIE (x,y) chromaticity to RGB for use of adjusting the default  
> sun and sky colors. I have researched the following site to get  
> some background about this:
>
> http://www.fourmilab.ch/documents/specrend/
>
> From searching through the archive of this message board I came  
> across a
> response by Greg to a previous question that I had for adjusting  
> the sun color:
>
> http://www.radiance-online.org/pipermail/radiance-general/2005- 
> January/002263.html
>
> My question is how may I convert from a CIE(x,y) chromaticity to  
> RGB using on two variables as was performed for the above. The  
> Radiance function file xyz_rgb.cal requires three variables (x,y  
> and the luminosity, z). The reason why I am asking this is because  
> I wish for the values that I'll employ to be in the physically  
> valid range (i.e. .265074126*r + .670114631*g + .064811243*b = 1).
>
> Thanks
>
> Marcus
>



More information about the Radiance-general mailing list