Colour (RGB/HSV/HSL) to wavelength.

In summary, the conversation discusses the possibility of converting RGB values to wavelengths, and the limitations and inaccuracies involved in this process. It is suggested to use a table of RGB values for visible wavelengths and find the closest match to the given color. The CIE color space is also mentioned as a more rigorous approach to converting wavelengths to RGB values. However, it is noted that there may still be inaccuracies in the conversion process.
  • #1
Archeleus
10
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
  • #2
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.
 
  • #3
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.
 
  • #4
In general, the colors we typically see include many wavelengths. Colors with single wavelengths are special cases.
 
  • #5
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.
 
  • #6
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?
 
  • #7
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.
 
  • #8
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.
 
  • #9
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!
 

1. What is the relationship between RGB, HSV, and HSL color models and wavelength?

The RGB (Red, Green, Blue), HSV (Hue, Saturation, Value), and HSL (Hue, Saturation, Lightness) color models are all based on the visible light spectrum, which consists of different wavelengths that correspond to different colors. RGB uses a combination of red, green, and blue light to create a wide range of colors, while HSV and HSL use hue (color), saturation (purity/intensity), and lightness/brightness to define colors.

2. How are wavelengths measured in relation to the RGB, HSV, and HSL color models?

Wavelengths are typically measured in nanometers (nm) and are represented by numbers in the RGB, HSV, and HSL color models. In RGB, each color channel has a value between 0 and 255, with 255 being the maximum intensity. In HSV and HSL, hue is typically represented by a number between 0 and 360, while saturation and lightness/brightness are represented by values between 0 and 1.

3. Can RGB, HSV, and HSL values be converted to wavelengths?

No, RGB, HSV, and HSL values cannot be directly converted to wavelengths. This is because these color models are not based on specific wavelengths, but rather on combinations of colors. However, there are formulas and algorithms that can be used to estimate the general range of wavelengths that a particular color value may fall within.

4. What is the importance of understanding the relationship between color models and wavelengths?

Understanding the relationship between color models and wavelengths is important for a variety of scientific and practical applications. For example, in the field of optics, understanding how different wavelengths of light interact with different materials can help researchers design better lenses and filters. In digital imaging and printing, understanding the color models and wavelengths can help ensure accurate color reproduction. Additionally, understanding the relationship between color models and wavelengths can also aid in the diagnosis and treatment of certain medical conditions that affect color vision.

5. Can the wavelength of a color be determined by looking at its RGB, HSV, or HSL values?

No, the wavelength of a color cannot be accurately determined by looking at its RGB, HSV, or HSL values. This is because these color models represent a range of wavelengths, rather than a specific one. Additionally, the human eye is not able to distinguish between different wavelengths of light with the same RGB, HSV, or HSL values. However, advanced color measurement tools and equipment can be used to accurately determine the wavelengths of a given color.

Similar threads

Replies
10
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
2K
Replies
17
Views
2K
  • Other Physics Topics
Replies
4
Views
2K
Replies
4
Views
880
  • STEM Career Guidance
2
Replies
62
Views
3K
Replies
11
Views
3K
Replies
13
Views
2K
  • Other Physics Topics
Replies
0
Views
718
Replies
31
Views
3K
Back
Top