[proFit-list] Color coding in ProFit scripts

Kevin Peter O'Donnell k.p.odonnell at strath.ac.uk
Fri Feb 13 05:36:02 CST 2009


My colleague Paul Edwards has done something similar for a  
hyperspectral imaging program:

I did it a more complicated way: Multiplying the spectrum or interest by
each of the three tabulated CIE color-matching functions, and then
converting the resultant three "tristimulus" values to x and y
chromaticity coordinates (basically going from 3 to 2 coordinates by
discarding the intensity information). If you then know the chromaticity
coordinates of pure R, G and B (which depend on your colour gamut) and
of white (for which different standards exist) you can work *a* set of
RGB values which correspond to the chromaticity coordinates you have
just calculated.

I'm sure that these steps can all be combined into a more efficient
one-step algorithm.

Paul suggests that you read (e.g.):

http://en.wikipedia.org/wiki/CIE_1931_color_space

Hope this helps.

On 12 Feb 2009, at 07:41, Jan Lagerwall wrote:

> Greetings,
>
> I'm trying to program an optics script where the data are plotted in
> real color (for the interested, I want to have ProFit produce a  
> Michel-
> Levy birefringence color chart) but I have some trouble getting from
> light wavelength to the corresponding R,G,B-values that I should send
> to SetLineColor. I found a quite simple algorithm at http://www.efg2.com/Lab/ScienceAndEngineering/Spectra.htm
>  but this first of all produces only 8-bit color, so the greater
> color depth of ProFit isn't used, second, the results aren't
> completely convincing. This is in particular because I need to mix the
> colors (I am running a loop over wavelengths, calculating the
> intensity for each color from 380nm to 780nm, and then summing the
> corresponding RGB values together, obviously normalizing the result
> before plotting).
>
> Does anyone have any experience in getting from light wavelength to
> RGB and how to program color mixing? While my current script is an OK
> first approximation, any help to further improve it would be greatly
> appreciated.
>
> Thanks
> Jan
>
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com

K.P. O'Donnell


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20090213/304c83de/attachment.html>


More information about the proFit-list mailing list