Colour (RGB/HSV/HSL) to wavelength.

  • Thread starter Thread starter Archeleus
  • Start date Start date
  • Tags Tags
    Colour Wavelength
AI Thread Summary
The discussion centers on the challenge of converting RGB color values to their corresponding wavelengths. It highlights that while it's possible to identify the color of a specific wavelength, reversing this process to find a wavelength from RGB values is generally not feasible due to the existence of non-spectral colors and the complexities of human vision. Participants suggest creating a table of RGB values for visible wavelengths to find the closest match, though accuracy may be limited. The conversation also touches on the CIE color space as a more rigorous method for understanding color perception and conversion. Ultimately, while some methods may yield approximate results, the inherent complexities of color perception complicate direct conversions.
Archeleus
Messages
10
Reaction score
0
I've been searching on this topic for the past 10 minutes and then realized it'll be better just asking someone about it. Anyway yeah, the question is, are there any specific equations that will give me the wavelength when I give it the colour values? I saw some sites where each colour in the rainbow was assigned a frequency. But I want to use RGB. Any suggestions?

Thanks.
 
Physics news on Phys.org
google: color value to wavelength
fourth link: http://www.filebuzz.com/findsoftware/Wavelength_Color/1.html
Might be what you want. But some of the other links look interesting too.

However there are "non-spectral" colors, e.g. magenta, that are artifacts of the eye sensor's construction so some RGB values don't have a physical embodiment.
 
No.
You can get the color of a given wavelength (more precisely, of a narrow spectrum centered on a single wavelength), but going the other way is not generally possible. Probably the best way to approach this would be to build a table of RGB values for visible wavelengths, then find the closest match to your given color, and report the wavelength and how close it was. You might do this more efficiently by concentrating on the hue.
 
In general, the colors we typically see include many wavelengths. Colors with single wavelengths are special cases.
 
ACPower said:
No.
You can get the color of a given wavelength (more precisely, of a narrow spectrum centered on a single wavelength), but going the other way is not generally possible. Probably the best way to approach this would be to build a table of RGB values for visible wavelengths, then find the closest match to your given color, and report the wavelength and how close it was. You might do this more efficiently by concentrating on the hue.

Hmm okay I'll give this a shot and like Dr Lotts o'Watts said, colours are of many wavelengths I guess, stupid of me to forget it. So basically if I use this method it means that it won't be that accurate. Though, if I calculate similarity based on distances on a RGB cube it might still be worth it.
 
I don't understand why the RGB->wavelength transform wold not be reversible, aside from the non-spectral-color issue, accounting for all the weird-and-wonderful strangeness of non-linear eye response in brightness, etc?

As to "colors containing many wavelengths"... It is possible for the eye to "see" a particular color in two ways, both of which involve excitation of particular cone sensors. One way is to tickle each sensor, say red and green, in just the right amount with two distinct wavelengths, so we "see" yellow. The other is to tickle the sensors by the same relative amounts with a single yellow wavelength. I think the latter is what the OP was getting at in doing the RGB conversion, yes?
 
Wavelength implies monochromatic light, so it strictly only includes colors along the standard rainbow spectrum. Do you see any pastels on that spectrum? What is the wavelength of white light?
If you are interested in the rigorous treatment of RGB color space and the human visual system, then you will end up becoming familiar with the CIE color space, which is a color model based on decomposing a given spectral distribution of wavelengths (i.e. a color) into a sum of three well-defined spectra corresponding to the spectral response of the 3 perception mechanisms in the human eye. The weights of these 3 curves are the CIE tristimulus values that express a color in CIE space. The process of converting an arbitrary distribution of visual wavelengths into an RGB color begins by integrating the spectrum with each of the tristimulus spectra to get a CIE color, then converting that to RGB given a certain definition of white.
 
ACPower said:
If you are interested in the rigorous treatment of RGB color space and the human visual system, then you will end up becoming familiar with the CIE color space, which is a color model based on decomposing a given spectral distribution of wavelengths (i.e. a color) into a sum of three well-defined spectra corresponding to the spectral response of the 3 perception mechanisms in the human eye. The weights of these 3 curves are the CIE tristimulus values that express a color in CIE space. The process of converting an arbitrary distribution of visual wavelengths into an RGB color begins by integrating the spectrum with each of the tristimulus spectra to get a CIE color, then converting that to RGB given a certain definition of white.

Thank you very much. I think I may have to use this.

And schip666, it may be possible but very inaccurate.
 
Ok,ok,ok... conversion is reversible where it is possible at all then? Being an engineer at heart, I'll take what ever works.

Thanks for the further info!
 
Back
Top