Newsgroups: sci.image.processing
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!newshost.marcam.com!zip.eecs.umich.edu!umn.edu!news
From: adkin003@gold.tc.umn.edu (dave adkins)
Subject: Re: wavelength <-> RGB?
Message-ID: <D3qJLD.7wB@news.cis.umn.edu>
Sender: news@news.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: dialup-4-31.gw.umn.edu
Organization: University of Minnesota, Twin Cities
X-Newsreader: WinVN 0.92.1
References: <1995Feb2.185009.7613@Princeton.EDU>
Date: Thu, 9 Feb 1995 13:45:46 GMT
Lines: 19

In article <1995Feb2.185009.7613@Princeton.EDU>, olszewsk@splash.Princeton.EDU (Jason Olszewski) says:
>
> Does anyone know of an algorithm for converting a wavelength (ie nanometer)
>to RGB values or vice-vera.  Any information or pointers would be very
>helpful.
>
>Thanks,
> Jason
>
>PS. have a nice day

If you know the spectrum that you wish to convert to RGB you must perform the
following computation Integral( Spectrum(lambda) * X(lambda) ) for lambda -> 400 to 750
nanometers. X(lambda) is the CIE observer function. This will give you the X,Y,Z 
values of the spectral distribution. You then need to convert the XYZ chromaticity
values into RGB colors. Look in "Digital Image PRocessing by William Pratt". He has a
section that covers this.


