[Radiance-general] RGB to CIE-XYZ

Raphael Compagnon raphael.compagnon at eif.ch
Wed Jun 29 10:32:30 CEST 2005


Sorry my previous answer was just irrelevant to your question...
In fact you need the inverse transformation. Here it is:

X=0.5142*r + 0.3240*g + 0.1618*b;
Y=0.2652*r + 0.6702*g + 0.0646*b;
Z=0.0240*r + 0.1229*g +  0.8531*b;

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

Hope this will help you.

Raphaël

At 28.06.2005 17:25, you wrote:
>Hi all!
>
>I have a question about converting RGB to CIE-XYZ with xyz_rgb.cal.
>
>For transforming XYZ into RGB I can use this lines:
>
>rcalc -f xyz_rgb.cal  -e 'ix=$1;iy=$2;iY=$3'  -f xyz_rgb.cal \
>-e 'iX=ix/iy*iY;iZ=(1-ix-iy)/iy*iY'  \
>-e '$1=R(iX,iY,iZ) ; $2=G(iX,iY,iZ) ; $3=B(iX,iY,iZ)'
>
>
>But there is also a part for calculating CIE-XYZ from RGB values, isn´t it?
>
>Unfortenatly, I don´t know what lines I have to write.
>
>Thanks,
>
>Nina
>
>
>_______________________________________________
>Radiance-general mailing list
>Radiance-general at radiance-online.org
>http://www.radiance-online.org/mailman/listinfo/radiance-general




More information about the Radiance-general mailing list