RGB to spectrum back

Board: Board index ‹ Ray tracing ‹ !Real time ‹ Off-line

(L) [2007/04/05] [fpsunflower] [RGB to spectrum] Wayback!

I have a question for those of you with spectral renderers:


What method do you use to get a spectrum from an arbitrary RGB triplet?


I found the following paper by Smitts online: [LINK http://www.cs.utah.edu/~bes/papers/color/] But it only applies to reflectances (values from 0 to 1).


How should one handle values that can go beyond 1 (converting an HDRI environment map for example)?
(L) [2007/04/05] [lycium] [RGB to spectrum] Wayback!

i imagine you can first normalise the hdr map, storing a gain coefficient, then proceed as normal?


i'll be tackling this problem before long myself, and have also wondered how it should be handled. of course a word from nick c / ono-sendai would be useful than my guess above :P
(L) [2007/04/10] [Ono-Sendai] [RGB to spectrum] Wayback!

I use Smits' technique as linked for rgb->spectrum conversion.
For HDRs it's simply a matter of letting the values exceed 1.
One consideration with HDRs used for environment lighting is that you will probably want to apply some kind of white balance correction, such as multiplying by a blackbody emission spectrum, to get a suitable result, not that I do that in Indigo [SMILEY :P]
(L) [2007/04/10] [Ono-Sendai] [RGB to spectrum] Wayback!

I use Smits' technique as linked for rgb->spectrum conversion.

For HDRs it's simply a matter of letting the values exceed 1.

One consideration with HDRs used for environment lighting is that you will probably want to apply some kind of white balance correction, such as multiplying by a blackbody emission spectrum, to get a suitable result, not that I do that in Indigo [SMILEY Razz]
_________________
[LINK http://indigorenderer.com/]
(L) [2007/04/11] [beason] [RGB to spectrum] Wayback!

Glassner has a simple way if you don't mind negative spectral values or are willing to clamp them.

[LINK http://portal.acm.org/citation.cfm?coll=GUIDE&dl=GUIDE&id=617504]

* sorry, don't have spectral renderer (unless you count three-wavelength spectrums [SMILEY :P])
(L) [2007/04/11] [beason] [RGB to spectrum] Wayback!

Glassner has a simple way if you don't mind negative spectral values or are willing to clamp them.


[LINK http://portal.acm.org/citation.cfm?coll=GUIDE&dl=GUIDE&id=617504]


* sorry, don't have spectral renderer (unless you count three-wavelength spectrums [SMILEY Razz])
(L) [2007/04/12] [syoyo] [RGB to spectrum] Wayback!

I think this one produces better result than Smits' one,

[LINK http://www.eml.hiroshima-u.ac.jp/member/person/Yoshinobu.t/cgsinpojium2003.pdf]

The paper is fully written in Japanese, but I think guy here are so smart enough to understand the method by reading only set of math equations [SMILEY ;)]
(L) [2007/04/12] [syoyo] [RGB to spectrum] Wayback!

I think this one produces better result than Smits' one,


[LINK http://www.eml.hiroshima-u.ac.jp/member/person/Yoshinobu.t/cgsinpojium2003.pdf]


The paper is fully written in Japanese, but I think guy here are so smart enough to understand the method by reading only set of math equations [SMILEY Wink]
(L) [2007/04/13] [fpsunflower] [RGB to spectrum] Wayback!

Thanks for the input guys. I'll try some of these methods.


syoyo: the paper you posted has formulas very similar to this paper:

[LINK http://www.cs.purdue.edu/homes/sun/CIRL/Publication/colorSpecTransf_CGA99.pdf]


What is the advantage/difference of the method they propose ?
(L) [2007/04/15] [syoyo] [RGB to spectrum] Wayback!

fpsunflower,

 >> fpsunflower wrote:syoyo: the paper you posted has formulas very similar to this paper:
[LINK http://www.cs.purdue.edu/homes/sun/CIRL/Publication/colorSpecTransf_CGA99.pdf]
What is the advantage/difference of the method they propose ?

OK, let me explain about Yoshinobu et al's method.

The method is basically the parameter modification of Sun's method.
( f_i(lambda), lambda_{c, i} and sigma_{i} )

The paper says that it converts RGB into more smoothly distributed spectral, while Sun's method is usually converts RGB into peaky distributed spectral.

For example,

Fig 6(b): spectral distribution of color of Fig 6(a) converted by Sun's method(peaky).
Fig 6(c): spectral distribution of color of Fig 6(a) converted by Yoshinobu et al's method(smoother).

As a result, Yoshinobu et al's method has less conversion err than Sun's method and is suited when you want to render interferrence effect thanks to smoother spectral distribution.
(L) [2007/04/15] [syoyo] [RGB to spectrum] Wayback!

fpsunflower,
(L) [2007/04/15] [fpsunflower] [RGB to spectrum] Wayback!

That makes sense.

So they propose to:

a) replace Sun's formula eq(3) by a typical Gaussian eq(4)

b) keep the original formulas to determine theta_i

c) replace Sun's theta_min,max=(10,150)nm by (80,150)nm to get wider basis functions

d) replace the lambda_c,i from Sun's method by slightly tweaked ones, shown in table (3).


Did I get that right?


Also, I see they've compared their method to Sun's, but the only reference to Smitt's paper is in the intro. What is their argument against that method? (Since Sun's work doesn't seem to compare against it either).

Thanks for the help [SMILEY :)]
(L) [2007/04/15] [fpsunflower] [RGB to spectrum] Wayback!

That makes sense.


So they propose to:


a) replace Sun's formula eq(3) by a typical Gaussian eq(4)


b) keep the original formulas to determine theta_i


c) replace Sun's theta_min,max=(10,150)nm by (80,150)nm to get wider basis functions


d) replace the lambda_c,i from Sun's method by slightly tweaked ones, shown in table (3).



Did I get that right?



Also, I see they've compared their method to Sun's, but the only reference to Smitt's paper is in the intro. What is their argument against that method? (Since Sun's work doesn't seem to compare against it either).


Thanks for the help [SMILEY Smile]
(L) [2007/04/15] [fpsunflower] [RGB to spectrum] Wayback!

I think Smitt's method is still the best though ... these other methods require 3 integrals and a matrix inverse to be calculated.
(L) [2007/04/16] [syoyo] [RGB to spectrum] Wayback!

>> fpsunflower wrote:That makes sense.
So they propose to:
a) replace Sun's formula eq(3) by a typical Gaussian eq(4)
b) keep the original formulas to determine theta_i
c) replace Sun's theta_min,max=(10,150)nm by (80,150)nm to get wider basis functions
d) replace the lambda_c,i from Sun's method by slightly tweaked ones, shown in table (3).

Did I get that right?

Yes, you are right(but I'd like to point out theta -> sigma typo).  
 >> fpsunflower wrote:Also, I see they've compared their method to Sun's, but the only reference to Smitt's paper is in the intro. What is their argument against that method? (Since Sun's work doesn't seem to compare against it either).
Thanks for the help
They say that in natural scene, distribution of spectrum is usually continuous and smooth.
Smits' method is a simple linear method(thus neither continuous nor smooth), so when a spectrum converted by Smits' method is backed into RGB color, reproduced RGB color has large error compared with original input RGB color.
 >> fpsunflower wrote:
I think Smitt's method is still the best though ... these other methods require 3 integrals and a matrix inverse to be calculated.   


It's your choise. [SMILEY :)]  If you prefer faster one than acculate one, Smits' one would be suitable for you.
(L) [2008/09/04] [flowirin] [RGB to spectrum] Wayback!

hi,
sorry to hop on your thread, but i need help!
im an artist, with a little computer background, and i'm trying to write some code that will take a rgb image and convert it into a 4 channel wave file, with each pixel contributing  a certain frequency based on its spectral component to each channel, dependant on position.
i've pretty much written it, and its slow and nasty, but i'm not happy with the rgb to spectral conversion algorithms i've found. basically, they produce three clumps of wavelengths, and that's not right.
i've read what you've written here, and it sounds like it might be what i need, but i'm not capable enought to convert the words and math into code.
has anyone written a general subroutine or whatever they are called these days to take an r, g and b input and give a spectral wavelength and intensity output? fancy sharing!
ta
(L) [2009/05/15] [gagar] [RGB to spectrum] Wayback!

First post!
I am currently looking into this RGB to spectrum conversion issue for my ray tracer.
I got Smit's paper, unfortunately the links to the two other mentionned in this thread are now broken...
Does anyone know where I could get them? (even feel free to send them to me if they happen to lay around somewhere in your computer  [SMILEY :wink:] )
Thanks!
EDIT: Found Sun's paper on IEEE. Need to consider whether to pay $19 for it...

back