Hi Will,
converting to sharp RGB:
-i think i can just change some constants in the xyz_rgb.cal file, (values for sharp RGB are given in Sharp.cal) to change the clour space.
You can actually run the same command, inserting -f Sharp.cal after -f xyz_rgb.cal (putting it before would do nothing).
-i assume that all colours (ie of materials as well as sources) have to be converted?
Yes, in fact to get the full benefit of the method, you should start with spectral data and premultiply the spectral power and reflectance of each surface material if it's available.
-the rendered picture will then be in th sharp RGB colour space, which ximage does not use, so every pixel in the image then has to be converted to back to the radiance RGB primaries. is this right? if so, is there a utility to apply the transformation to a .pic file or do i need to write a script?
Here is one of the missing bits in the process. Radiance doesn't care what color space it renders in, but the default of downstream picture tools is to use the standard primaries defined in color.h if none are specified in the picture file. Therefore, it is best if you specify the correct color primaries following your rendering using a script like so:
#!/bin/csh -f
# Add Sharp color primaries to Radiance picture header
foreach f ($*)
getinfo < $f > tf$$
ed - tf$$ << '_EOF_'
/^PRIMARIES=/d
/^FORMAT=/i
PRIMARIES= .6898 .3206 .0736 .9003 .1166 .0374 .3333 .3333
.
w
q
'_EOF_'
getinfo - < $f >> tf$$
mv tf$$ $f
end
You can accomplish the same thing manually using the "vinfo" script that comes with Radiance, but the above lets you convert a set of pictures more quickly and conveniently. I would call it addSharp or something like that.
Once your Radiance picture has the right primaries installed in its header, some but not all of the Radiance tools will know what to do with them. To convert the image back to the standard Radiance color space, you can use:
ra_xyze -r sharp.pic standard.pic
Obviously, this would also work with an XYZE input picture. The converters pcond, ra_bmp, and ra_tiff also understand the PRIMARIES= header line, as does Photosphere, which will display the images correctly without preconversion.
white point adjustment:
-presumably the white point that radiance uses is the same as most monitors (D65 i think) so i need to transform from the white point of the XYZ colour space to that of the sharp RGB (or radiance RGB) colour space, but only because of this change in colour space.
Radiance uses an equal-energy white (x,y)=(1/3,1/3) by default, and this is the default for the Sharp color space and XYZ as well, so no need to convert the white point for Radiance.
-can anyone start me off with how to apply the white point transformation? i assume it uses the vonKries.cal file, and that the inputs (initial and final white point cramaticities) are standard values for the colour spaces in question, but how is it used!?
Thankfully, ra_xyze and the other tools do a vonKries-style white point conversion for you, so you needn't worry about this bit.
-the XYZ data (and the xy coordinates) i have are given for both a C source (the CIE standard?) and for a tungsten lamp with colout temp 3200K, so i presume i should use the tungsten readings (as my lamps are tungsten).
Yes, indeed.
-the sources i am modelling are tungsten, but i want an accurate representation of what the colour will look like, so presumably i need some sort of white point transformatin to correct their slight orangeness, as the eye is quite good at correcting this, i believe. how should i specify this? i know the lamps' colour temperature (about 3200K).
The CIE (x,y) chromaticity for a 3200K black body is (0.4234,0.3990). You can use the formula in blackbody.cal to convert color temperature to spectral power, and then the CIE standard observers to get to XYZ.
and finally, how should i apply the colour to my sources?
You can premultiply the illuminant and reflectance values (using Sharp RGB) and put neutral light sources for your dominant source (tungsten 3200K). This is spelled out towards the end of section 2 in the EGWR paper.
-i have XYZ tristimulus and xy cromaticity coordinate data for the filters i want to use, but i'm not sure of the best way to apply it.
(data comes from eg. http://www.leefilters.com/LPFD.asp?PageID=248 )
Convert to Sharp RGB and multiply this value if you don't have spectral data. If you have spectral data for the filters, you are better off using that. (I see they have a plot on their website, so maybe they'll give you data as well.)
-i could either the calculated RGB values to scale the output from my source primative (though would i have to take the Y value (reflectance/transmission depending on the context i believe) into account, or is this done automatically in the conversion?). This is what i did for my first test run earlier (converting XYZ values to radiance RGB primaries, and then not using the Y value again), and the result seemed to bright for the filter i was using (i had 2 sources in the scene, one coloured, the other not, and they were both of similar brigtness).
Luminance should pass through the conversion with minimal changes, but this is only really guaranteed if you use properly normalized spectra rather than RGB multiplication.
-or i could use the RGB values to define the transmission of a thin piece of glass, and place this in front of the source (as a real filter is).
The net result would be (nearly) the same, but the glass would be more expensive to compute.
-Greg