Spectrum Were Sorry
To catechumen a wavelength into an RGB color
Beginning you consult a CIE 1964 Supplementary Standard Colorimetric Observer nautical chart (archive)
https://imgur.com/a/JDatZNm
and look upwardly the CIE color matching office values for the wavelength you lot want.
For example, i desire to go the color of 455 nm light:
For our desired wavelength:
| nm | CIE color matching functions | Chromacity coordinates | | nm | X | Y | Z | x | y | z | |-----|----------|----------|---------|---------|---------|---------| | 455 | 0.342957 | 0.106256 | 1.90070 | 0.14594 | 0.04522 | 0.80884 |
Note: The chromacity coordinates are but calculated from the CIE color matching functions:
10 = X / (X+Y+Z) y = Y / (X+Y+Z) z = Z / (Z+Y+Z)
Given that:
X+Y+Z = 0.342257+0.106256+one.90070 = 2.349913
nosotros calculate:
x = 0.342257 / ii.349913 = 0.145945 y = 0.106256 / 2.349913 = 0.045217 z = i.900700 / 2.349913 = 0.808838
Yous accept your 455 nm light specified using two dissimilar color spaces:
- XYZ: (0.342957, 0.106256, one.900700)
- xyz: (0.145945, 0.045217, 0.808838)
Nosotros can besides add together a third colour space: xyY
x = x = 0.145945 y = y = 0.045217 Y = y = 0.045217
We now accept the 455 nm light specified in 3 unlike colour spaces:
- XYZ: (0.342957, 0.106256, ane.900700)
- xyz: (0.145945, 0.045217, 0.808838)
- xyY: (0.145945, 0.045217, 0.045217)
So we've converted a wavelength of pure monochromatic emitted low-cal into a XYZ color. Now we want to catechumen that to RGB.
How to catechumen XYZ into RGB?
XYZ, xyz, and xyY are absolute colour spaces that depict colors using absolute physics.
Meanwhile, every practical color spaces that people employ:
- Lab
- Luv
- HSV
- HSL
- RGB
depends some whitepoint. The colors are and so described every bit beingness relative to that whitepoint.
For example,
- RGB white (255,255,255) means "white"
- Lab white (100, 0, 0) means "white"
- LCH white (100, 0, 309) ways "white"
- HSL white (240, 0, 100) means "white"
- HSV white (240, 0, 100) means "white"
But in that location is no such color as white. How practise y'all ascertain white? The colour of sunlight?
- at what time of twenty-four hours?
- with how much deject cover?
- at what latitude?
- on Earth?
Some people employ the white of their (horribly orangish) incandescent bulbs to mean white. Some people use the color of their florescent lights. In that location is no accented physical definition of white - white is in our brains.
Then we have to pick a white
Nosotros have to pick a white. (Really you have to choice a white.) And there are plenty of whites to cull from:
I volition option a white for you. The aforementioned white that sRGB uses:
- D65 - daylight illumination of clear summer mean solar day in northern Europe
D65 (which has a color close to 6504K, but not quite considering of the Earth's atmosphere), has a colour of:
- XYZ_D65: (0.95047, 1.00000, one.08883)
With that, you can convert your XYZ
into Lab
(or Luv
) - a colour-space equally capable of expressing all theoretical colors. And now we accept a 4th color infinite representation of our 445 nm monochromatic emission of calorie-free:
- XYZ: (0.342957, 0.106256, i.900700)
- xyz: (0.145945, 0.045217, 0.808838)
- xyY: (0.145945, 0.045217, 0.045217)
- Lab: (38.94259, 119.14058, -146.08508) (assuming d65)
But yous want RGB
Lab
(and Luv
) are color spaces that are relative to some white-point. Even though you were forced to selection an arbitrary white-point, you can however stand for every possible color.
RGB is not like that. With RGB:
- not only is the colour relative to some white-point
- but is is also relative to three master colors: red, green, blue
If you specify an RGB color of (255, 0, 0), you are saying you desire "just red". But there is no definition of red. In that location is no such thing as "scarlet", "green", or "blue". The rainbow is continuous, and doesn't come with an arrow saying:
This is red
And again this means we have to pick 3 choice three primary colors. You have to option your three primary colors to say what "red", "greenish", and "bluish" are. And again you lot have many unlike defintions of Red,Green,Blue to choose from:
- CIE 1931
- ROMM RGB
- Adobe Wide Gamut RGB
- DCI-P3
- NTSC (1953)
- Apple tree RGB
- sRGB
- Japanese NTSC
- PAL/SECAM
- Adobe RGB 98
- scRGB
I'll pick for you. I'll option these 3 colors:
- Red: xyY = (0.6400, 0.3300, 0.2126)
- Green: xyY = (0.3000, 0.6000, 0.7152)
- Blue: xyY = (0.1500, 0.0600, 0.0722)
Those were also the primaries chosen for past an international committee in 1996.
They created a standard that said everyone should use:
- Whitepoint: D65 daylight
- Reddish: (0.6400, 0.3300, 0.2126)
- Greenish: (0.3000, 0.6000, 0.7152)
- Blue: (0.1500, 0.0600, 0.0722)
And they called that standard sRGB
.
The final push
Now that we accept called our
- white-point
- three primaries
nosotros can now catechumen you XYZ color into RGB:
- RGB = (1.47450, -178.21694, 345.59392)
Unfortunately at that place are some problems with that RGB value:
- your monitor cannot display negative light-green (-178.21694); that means information technology'southward a color exterior what your monitor can display.
- your monitor cannot display more blue than 255 (345.59392); the monitor only only be as blueish as the blue is - information technology can't get any bluer. That means it'southward a color outside what your monitor can display.
And so nosotros have to round:
- XYZ: (0.342957, 0.106256, ane.900700)
- xyz: (0.145945, 0.045217, 0.808838)
- xyY: (0.145945, 0.045217, 0.045217)
- Lab: (38.94259, 119.14058, -146.08508) (d65)
- RGB: (i, 0, 255) (sRGB)
And now we have the closest approximation sRGB of wavelength 455 nm of light:
Source: https://stackoverflow.com/questions/3407942/rgb-values-of-visible-spectrum
0 Response to "Spectrum Were Sorry"
Post a Comment