Re: Colour algorithms - how light affects an object



Philip Pemberton wrote:
Hi,
I'm working on some software to manipulate colour palettes, and I'm looking for some info on colour algorithms. More specifically, I'm trying to answer the question "If an object is a given colour, and the ambient light is another colour, what RGB colour should I use to render the object to make it look realistic?".

That's a tough question. Let's start with the basics: You have a light source, a reflecting object and an observer. The light source emits light with a certain spectral distribution. There's not just red, green and blue light, but a continuous frequency spectrum. Have a look at http://en.wikipedia.org/wiki/Image:High_Resolution_Solar_Spectrum.jpg to see a high resolution spectrum of sun light: It contains almost all frequencies with a few bands missing. On the contrary, there are light sources such as LED that emit only very narrow bands (http://en.wikipedia.org/wiki/Image:Red-YellowGreen-Blue_LED_spectra.gif). When light interacts with an reflecting object, some of the frequencies are filtered out. There are even more "advanced" materials that can "shift" frequencies (http://en.wikipedia.org/wiki/Fluorescence). All this happens in a continous frequency space - no sign of RGB, yet. As soon as the light reaches the observer, it is usually reduced to RGB: Your eyes have three different cell types that detect light in certain frequency bands. You basically multiply the spectrum of the incoming light with the spectrum of a sensor cell type, integrate the result and that's what you see as red, green of blue respectively.

Working solely in RGB works only if you don't have narrow filters in this chain: Your light source emits somewhat more low frequencies than high ones (bonfire, light bulbs), object look a bit more reddish ("warm") than in sun light. But both sunlight and fire emit a very broad range of frequencies. If you have a light source with narrow bands and an object that absorbs just these frequencies, is appears dark even though it might have a distinctive color in sunlight. This effect is actually used in a new kind of passive stereo glasses: Infitec produces filters with extremely narrow RGB spectra. One pair with different specra is applied to the projecting device, the corresponding pair is used in your glasses. This way you can show entirely different images in full RGB color to both eyes: http://www.infitec.net/infitec_english.pdf.

To cut a long story short: If you are aware of the fact that calculating light reflections in RGB has it's shortcomings, you just can just multiply the frequency coefficients of light and object (R,G,B = R_light*R_object, G_l*G_e, B_l*B_o). This approximation is inherently flawed but workes so well that almost all computer graphics applications restrict themselves to RGB. As long as you don't expect accurate results in the presence of lights with narrow bands in their spectra, it should do the job.

Malte
.



Relevant Pages

  • How to convert RGB to different frequency
    ... I was wondering anybody knows how to convert RGB value to different ... frequencies of spectrum? ... Chung ...
    (comp.soft-sys.matlab)
  • Re: Contious optical receiver
    ... What differ a prism from a RGB mask? ... Well visible light have a range Wikipedia"The visible spectrum (or ... It isn't simply pure wavelength. ... RGB OR CMYK IS JUST FILTERS FOR "ONE WAVE LENGTH" YOU COULD PROBABLY ...
    (sci.physics)
  • Re: Damn it...comments about a mix
    ... Currently especially the kick spoils the bass end. ... spectrum information there battling with the bass. ... The flute has very strong peaks at certain frequencies in the ... analyzer, ...
    (alt.guitar)
  • Re: Damn it...comments about a mix
    ... Currently especially the kick spoils the bass end. ... spectrum information there battling with the bass. ... The flute has very strong peaks at certain frequencies in the ... analyzer, ...
    (alt.guitar)
  • Re: Yellow
    ... determined from the broadcast RGB signal. ... sub-pixel is fired and the R and G are dimmed to compensate. ... to have seven sub-pixels (ROYGBIV) and to process the RGB input to ... For light you simply record the spectrum with a decent spectrometer to get the intensity against wavelength. ...
    (uk.tech.digital-tv)