Thursday 14 June 2018

Why are Red, Green, and Blue the primary colors of light?


Colors don't have to be a mixture of red, green, and blue because visible light can be any wavelengths in the 390nm-700nm range. Do primary colors really exist in the real world? Or did we select red, green, and blue because those are the colors that human eyes' cones respond to?



Answer



TL:DR



Do primary colors really exist in the real world?



No.


There are no primary colors of light, in fact there is no color intrinsic in light at all (or any other wavelength of electromagnetic radiation). There are only colors in the perception of certain wavelengths of EMR by our eye/brain systems.




Or did we select red, green, and blue because those are the colors that human eyes' cones respond to?



We use three-color reproduction systems because the human vision system is trichromatic, but the primary colors we use in our three-color reproduction systems do not match each of the three colors, respectively, to which each of the three types of cones in the human retina are most responsive.




Short Answer


There's no such thing as "color" in nature. Light only has wavelengths. Electromagnetic radiation sources on either end of the visible spectrum also have wavelengths. The only difference between visible light and other forms of electromagnetic radiation, such as radio waves, is that our eyes chemically react to certain wavelengths of electromagnetic radiation and do not react to other wavelengths. Beyond that there is nothing substantially different between "light" and "radio waves" or "X-rays". Nothing.


Our retinas are made up of three different types of cones that are each most responsive to a different wavelength of electromagnetic radiation. In the case of our "red" and "green" cones there is very little difference in the response to most wavelengths of light. But by comparing the difference and which has a higher response, the red or the green cones, our brains can interpolate how far and in which direction towards red or towards blue, the light source is strongest.


Color is a construct of our eye brain system that compares the relative response of the three different types of cones in our retinas and creates a perception of "color" based on the different amounts each set of cones responds to the same light. There are many colors humans perceive that can not be created by a single wavelength of light. "Magenta", for instance, is what our brains create when we are simultaneously exposed to red light on one end of the visible spectrum and blue light on the other end of the visible spectrum.


Color reproduction systems have colors that are chosen to serve as primary colors, but the specific colors vary from one system to the next, and such colors do not necessarily correspond to the peak sensitivities of the three types of cones in the human retina. "Blue" and "Green" are fairly close to the peak response of human S-cones and M-cones, but "Red" is nowhere near the peak response of our L-cones.





Extended Answer


The spectral response of color filters on Bayer masked sensors closely mimics the response of the three different types of cones in the human retina. In fact, our eyes have more "overlap" between red and green than most digital cameras do.


The 'response curves' of the three different types of cones in our eyes:
enter image description here Note: The "red" L-line peaks at about 570nm, which is what we call 'yellow-green', rather than at 640-650nm, which is the color we call "Red."


A typical response curve of a modern digital camera:
enter image description here
Note: The "red" filtered part of the sensor peaks at 600nm, which is what we call "orange", rather than 640nm, which is the color we call "Red."


The IR and UV wavelengths are filtered by elements in the stack in front of the sensor in most digital cameras. Almost all of that light has already been removed before the light reaches the Bayer mask. Generally, those other filters in the stack in front of the sensor are not present and IR and UV light are not removed when sensors are tested for spectral response. Unless those filters are removed from a camera when it is used to take photographs, the response of the pixels under each color filter to, say, 870nm is irrelevant because virtually no 800nm or longer wavelength signal is being allowed to reach the Bayer mask.




  • Without the 'overlap' between red, green and blue (or more precisely, without the overlapping way the sensitivity curves of the three different types of cones in our retinas are shaped to light with peak sensitivity centered on 565nm, 540nm, and 445nm) it would not be possible to reproduce colors in the way that we perceive many of them.

  • Our eye/brain vision system creates colors out of combinations and mixtures of different wavelengths of light as well as out of single wavelengths of light.

  • There is no color that is intrinsic to a particular wavelength of visible light. There is only the color that our eye/brain assigns to a particular wavelength or combination of wavelengths of light.

  • Many of the distinct colors we perceive can not be created by a singular wavelength of light.

  • On the other hand, the response of human vision to any particular single wavelength of light that results in the perception of a certain color can also be reproduced by combining the proper ratio of other wavelengths of light to produce the same biological response in our retinas.

  • The reason we use RGB to reproduce color is not because the colors 'Red', 'Green', and 'Blue' are somehow intrinsic to the nature of light. They aren't. We use RGB because trichromatism¹ is intrinsic to the way our eye/brain systems respond to light.


The Myth of our "Red" cones and the Myth of "Red" filters on our Bayer masks.


Where a lot of folks' understanding of 'RGB' as being intrinsic to the human vision system runs off the rails is in the idea that L-cones are most sensitive to red light somewhere around 640nm. They are not. (Neither are the filters in front of the "red" pixels on most of our Bayer masks. We'll come back to that below.)


Our S-cones ('S' denotes most sensitive to 'short wavelengths', not 'smaller in size') are most sensitive to about 445nm, which is the wavelength of light most of us perceive as a slightly bluer than red version of purple.



Our M-cones ('medium wavelength') are most sensitive to about 540nm, which is the wavelength of light most of us perceive as a slightly blue-tinted green.


Our L-cones ('long wavelength') are most sensitive to about 565nm, which is the wavelength of light most of us perceive as yellow-green with a bit more green than yellow. Our L-cones are nowhere near as sensitive to 640nm "Red" light than they are to 565nm "Yellow-Green" light!


As the simplified first graph above illustrates, there's not that much difference between our M-cones and L-cones. But our brains use that difference to perceive "color."


From comments by another user to a different answer:



Imagine an extraterrestrial alien who has yellow as a primary color. She would find our color prints and screens lacking. She would think we would be partially color blind not seeing the difference between the world she perceives and our color prints and screens.



That's actually a more accurate description of the sensitivities of our cones that are most sensitive to around 565nm than describing the peak sensitivity of L-cones as "red" when 565nm is on the 'green' side of 'yellow'. The color we call "Red" is centered on about 640nm, which is on the other side of "orange" from "yellow."


Why we use three colors in our color reproduction systems


To recap what we've covered up to this point:



There are no primary colors of light.


It is the trichromatic nature of human vision that allows tri-color reproduction systems to more or less accurately mimic the way we see the world with our own eyes. We perceive a large number of colors.


What we call "primary" colors are not the three colors we perceive for the three wavelengths of light to which each type of cone is most sensitive.


Color reproduction systems have colors that are chosen to serve as primary colors, but the specific colors vary from one system to the next, and such colors do not directly correspond to the peak sensitivities of the three types of cones in the human retina.


The three colors, whatever they might be, used by reproduction systems do not match the three wavelengths of light to which each type of cone in the human retina is most sensitive.


If, for example, we wanted to create a camera system that would provide 'color accurate' images for dogs we would need to create a sensor that is masked to mimic the response of the cones in dogs' retinas, rather than one that mimics the cones in human retinas. Due to only two types of cones in dog retinas, they see the "visible spectrum" differently than we do and can differentiate much less between similar wavelengths of light than we can. Our color reproduction system for dogs would only need to be based on two, rather than three, different filters on our sensor masks.


enter image description here


The chart above explains why we think our dog is dumb for running right past that brand new shiny bright red toy we just threw out in the yard: he can barely see the wavelengths of light that we call "red." It looks to a dog like a very dim brown looks to humans. That, combined with the fact dogs don't have the ability to focus at close distances the way humans do - they use their powerful sense of smell for that - leaves him at a distinct disadvantage since he's never smelled the new toy you just pulled out of the packaging it came in.


Back to humans.


The Myth of "only" red, "only" green, and "only" blue



If we could create a sensor so that the "blue" filtered pixels were sensitive to only 445nm light, the "green" filtered pixels were sensitive to only 540nm light, and the "red" filtered pixels were sensitive to only 565nm light it would not produce an image that our eyes would recognize as anything resembling the world as we perceive it. To begin with, almost all of the energy of "white light" would be blocked from ever reaching the sensor, so it would be far less sensitive to light than our current cameras are. Any source of light that didn't emit or reflect light at one of the exact wavelengths listed above would not be measureable at all. So the vast majority of a scene would be very dark or black. It would also be impossible to differentiate between objects that reflect a LOT of light at, say, 490nm and none at 615nm from objects that reflect a LOT of 615nm light but none at 490nm if they both reflected the same amounts of light at 540nm and 565nm. It would be impossible to tell apart many of the distinct colors we perceive.


Even if we created a sensor so that the "blue" filtered pixels were only sensitive to light below about 480nm, the "green" filtered pixels were only sensitive to light between 480nm and 550nm, and the "red" filtered pixels were only sensitive to light above 550nm we would not be able to capture and reproduce an image that resembles what we see with our eyes. Although it would be more efficient than a sensor described above as sensitive to only 445nm, only 540nm, and only 565nm light, it would still be much less sensitive than the overlapping sensitivities provided by a Bayer masked sensor. The overlapping nature of the sensitivities of the cones in the human retina is what gives the brain the ability to perceive color from the differences in the responses of each type of cone to the same light. Without such overlapping sensitivities in a camera's sensor, we wouldn't be able to mimic the brain's response to the signals from our retinas. We would not be able to, for instance, discriminate at all between something reflecting 490nm light from something reflecting 540nm light. In much the same way that a monochromatic camera can not distinguish between any wavelengths of light, but only between intensities of light, we would not be able to discriminate the colors of anything that is emitting or reflecting only wavelengths that all fall within only one of the the three color channels.


Think of how it is when we are seeing under very limited spectrum red lighting. It is impossible to tell the difference between a red shirt and a white one. They both appear the same color to our eyes. Similarly, under limited spectrum red light anything that is blue in color will look very much like it is black because it isn't reflecting any of the red light shining on it and there is no blue light shining on it to be reflected.


The whole idea that red, green, and blue would be measured discreetly by a "perfect" color sensor is based on oft repeated misconceptions about how Bayer masked cameras reproduce color (The green filter only allows green light to pass, the red filter only allows red light to pass, etc.). It is also based on a misconception of what 'color' is.


How Bayer Masked Cameras Reproduce Color


Raw files don't really store any colors per pixel. They only store a single brightness value per pixel.


It is true that with a Bayer mask over each pixel the light is filtered with either a "Red", "Green", or "Blue" filter over each pixel well. But there's no hard cutoff where only green light gets through to a green filtered pixel or only red light gets through to a red filtered pixel. There's a lot of overlap.² A lot of red light and some blue light gets through the green filter. A lot of green light and even a bit of blue light makes it through the red filter, and some red and green light is recorded by the pixels that are filtered with blue. Since a raw file is a set of single luminance values for each pixel on the sensor there is no actual color information to a raw file. Color is derived by comparing adjoining pixels that are filtered for one of three colors with a Bayer mask.


Each photon vibrating at the corresponding frequency for a 'red' wavelength that makes it past the green filter is counted just the same as each photon vibrating at a frequency for a 'green' wavelength that makes it into the same pixel well.³


It is just like putting a red filter in front of the lens when shooting black and white film. It didn't result in a monochromatic red photo. It also doesn't result in a B&W photo where only red objects have any brightness at all. Rather, when photographed in B&W through a red filter, red objects appear a brighter shade of grey than green or blue objects that are the same brightness in the scene as the red object.


The Bayer mask in front of monochromatic pixels doesn't create color either. What it does is change the tonal value (how bright or how dark the luminance value of a particular wavelength of light is recorded) of various wavelengths by differing amounts. When the tonal values (gray intensities) of adjoining pixels filtered with the three different color filters used in the Bayer mask are compared then colors may be interpolated from that information. This is the process we refer to as demosaicing.



What Is 'Color'?


Equating certain wavelengths of light to the "color" humans perceive that specific wavelength is a bit of a false assumption. "Color" is very much a construct of the eye/brain system that perceives it and doesn't really exist at all in the portion of the range of electromagnetic radiation that we call "visible light." While it is the case that light that is only a discrete single wavelength may be perceived by us as a certain color, it is equally true that some of the colors we perceive are not possible to produce by light that contains only a single wavelength.


The only difference between "visible" light and other forms of EMR that our eyes don't see is that our eyes are chemically responsive to certain wavelengths of EMR while not being chemically responsive to other wavelengths. Bayer masked cameras work because their sensors mimic the trichromatic way our retinas respond to visible wavelengths of light and when they process the raw data from the sensor into a viewable image they also mimic the way our brains process the information gained from our retinas. But our color reproduction systems rarely, if ever, use three primary colors that match the three respective wavelengths of light to which the three types of cones in the human retina are most responsive.


¹ There are a very few rare humans, almost all of them female, who are tetrachromats with an additional type of cone that is most sensitive to light at wavelengths between green (540nm) and red (565nm). Most such individuals are functional trichromats. Only one such person has been positively identified to be a functional tetrachromat. The subject could identify more colors (in terms of finer distinctions between very similar colors - the range at both ends of the 'visible spectrum' were not extended) than other humans with normal trichromatic vision.


² Keep in mind that the "red" filters are usually actually a yellow-orange color that is closer to "red" than the greenish-blue "green" filters, but they are not actually "Red." That's why a camera sensor looks blue-green when we examine it. Half the Bayer mask is a slightly blue-tinted green, one quarter is a blue-tinted purple, and one-quarter is a yellow-orange color. There is no filter on a Bayer mask that is actually the color we call "Red", all of the drawings on the internet that use "Red" to depict them notwithstanding.


³ There are very minor differences in the amount of energy a photon carries based on the wavelength at which it is vibrating. But each sensel (pixel well) only measures the energy, it doesn't discriminate between photons that have slightly more or slightly less energy, it just accumulates whatever energy all of the the photons that strike it release when they fall on the silicon wafer within that sensel.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...