Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An RGB to Spectrum Conversion for Reflectances Brian Smits University of Utah January 21, 2000

8 views
Skip to first unread message

Thomas Plehn

unread,
Feb 9, 2012, 8:11:27 AM2/9/12
to
Hello,

in the above paper, an algorithm for conversion from rgb to spectra is
presented. The emphasis lies on physically plausible reflection
spectra. There is a pseudocode algorithm, which I have copied here. My
problem is that the algorithm is not pointed out completely. Only the
first of three cases are mentioned completely. Can someone help me to
undestand the other three cases?

--------------------------
A reasonable solution is to continue to exploit the linearity
of the conversions, and create spectra for red, green, blue, cyan,
magenta, yellow, and
white. The spectra for cyan, magenta, and yellow can be found in
Figure 5. In the
same way that the white spectrum is better than a sum of red, green,
and blue, the cyan,
magenta, and yellow spectra are better than the sum of the appropriate
red, green, and
blue spectra. Ideally, the conversion would use as much of the
constant white spec-

tra as possible, followed by the secondary colors, and mix in primary
colors only as
needed. Any color can be expressed as a sum of white, plus one of
cyan, magenta, or
yellow, plus one of red, green, or blue. The conversion process works
by subtracting
off as much of the wider spectra (first white, then either cyan,
magenta, or yellow) as
possible before converting the remainder using the red, green, or blue
spectra. This can
be expressed in pseudocode as follows for a spectrum where red is less
than green and
blue:

Spectrum RGBToSpectrum(red,green,blue)
Spectrum ret = 0;
if(red green && red blue)
ret += red * whiteSpectrum;
if(green blue)
ret += (green - red) * cyanSpectrum;
ret += (blue - green) * blueSpectrum;
else
ret += (blue - red) * cyanSpectrum;
ret += (green - blue) * greenSpectrum;
else if(green red && green blue)
...
else // blue red && blue green
...
The other two cases are similar.
0 new messages