# Why are RGB and CMY the primary colors?

The RGB color model is supposed to describe how additive color works, and the CMY model how subtractive color works. But a number of things don't add up, some even appearing to violate laws of physics. Just a few examples:

• Red, green, and blue are the only (additive) colors that cannot be created by mixing other colors. What makes them primary colors, or even unique?
• The RGB model says red light plus green light produces yellow light. Each color has its own wavelength. How can combining two wavelengths produce a third, all in the same wavelength ballpark?
• White light is a collection of all the wavelengths of visible light. Red, green, and blue light are just three wavelengths. How can just red, green, and blue create all the other wavelengths in white light?
• If the color model is based on physics principles of how light works, it seems like it ought to explain the full range of wavelengths used for vision in the animal kingdom. That whole range should behave similarly. Why does it describe how colors work only for the color range of human vision.
• The equivalent question for CMY.

In other words, why (and how) are RGB and CMY the primary colors?

• In addition to very good answer from fixer1234, look for term 'metamerism'.
– Arvo
Apr 6, 2022 at 9:58
• There are quite a few similar questions in both Physics.SE and Photography.SE. Apr 7, 2022 at 12:39
• Side note: Isn't CMY simply RGB offset by 60⁰? Apr 7, 2022 at 20:31
• @csstudent1418, you mean on the color wheel? The set of CMY colors are rotated by 60 compared to the set of RGB colors, but there's more to the relationship than that, so "simply" doesn't apply. :-) It would be more accurate to think of them as rotated 180. Apr 7, 2022 at 21:43
• @fixer1234 Oh wow true, I never realized that. That's why C is also the inverse of R etc ... Apr 11, 2022 at 0:12

TL;DR: The RGB model isn't really a model of how light works. It's a model of how our vision system processes color. Red, green, and blue are like keys that manipulate our vision system; that's what makes them primary colors. The creation and use of RGB colors "hacks" our vision system to create optical illusions of color that we can't distinguish from real color. The answer explores the integral relationship between RGB and our vision system for an appreciation of why RGB are the primary colors. CMY is an extrapolation of RGB.

## RGB

Color Vision

Color is how we perceive different light wavelengths. Virtually all of the characteristics of how colors interact are defined by how our vision system processes and perceives color. So let's start with color vision.

Visible light is a continuum of wavelengths. We need an efficient way to process the near-infinite color information that bombards us in real-time. Nature has come up with a solution. Our vision system performs some simplifications and abstractions. It reduces color to a "shorthand" representation, which is what our brain then uses.

How it works and why RGB are primary colors

Our eyes have three kinds of photoreceptors for color vision (cones). They react to short, medium, or long wavelengths of light, and their sensitivities overlap.

Notice that the sensitivity curves don't evenly divide the color spectrum, with one type sensitive to blue, one to green, and one to red. In fact, the medium and long wavelength cones almost (but not quite), completely overlap. At the far ends of the spectrum, it is mainly one kind of cone that is stimulated. For most of the spectrum, a given wavelength stimulates either two or three kinds of cones to some extent.

Each type of cone will react to a broad range of colors, but can't tell what color light stimulated it. Any wavelength it is sensitive to will stimulate it, but the closer the wavelength is to the cone's sensitivity peak, the more it will be stimulated.

Your vision system interprets this by comparing the output signals of the three kinds of cones to each other to deduce what color light would have produced that combination of reactions. The result is translated to a color representation, which is what we perceive.

Red, green, and blue are like code keys that trigger perception of a given color. Their ability to trigger a whole gamut of color perceptions that mirror our experience with real color is what makes them primary colors.

Could different primary colors work?

The short answer is no. A longer explanation:

Color (your experience of it), is what your vision system says it is, and it behaves as your vision system is designed. Any other primary color scheme won't produce the same result when processed by your vision system.

One reason is that, in part, externally created RGB output works through optical illusions, tricking your vision system based on how your cones work and how their output is interpreted (more explanation later). To do that, any color system needs to mirror how your vision system works, including the sensitivity profiles of the cones.

Another reason is that RGB is a simplification. Color information that isn't needed to perceive color is discarded (more explanation later). There are holes in the color information that don't usually affect you. A different primary color scheme will have a different set of holes, which won't align with how your vision system processes color.

RGB vs. Vision System

In nature, color is a linear progression of wavelengths, not a color wheel. Red, green, and blue are simply three colors that can be combined independent of the color spectrum, so the linear nature of the spectrum becomes irrelevant. That allows treating them as a color wheel, and representing colors that don't exist as a wavelength in the visible spectrum.

For example, blue light is at one end of the visible sprectrum, and red light is at the other. There is no wavelength for magenta. But magenta can be represented with the RGB information.

Our vision system normally provides good color perception if it is interpretting the color of real objects illuminated with broad-spectrum light. But if we artificially create colors or illumination using RGB, some strange things can happen.

RGB electronic displays don't really reproduce the colors reflected off the original, illuminated object. They produce optical illusions that your vision system interprets as the intended color. Your vision system can't differentiate whether it is seeing normal light or RGB. That allows coding of "misinformation" to trick your vision system. In this case, we're using it as a benefit. (I'll cover some examples below.)

If you illuminate with RGB light, it can mess up colors and illustrate the holes in the color information. Although the light can look white, the wavelengths needed to reflect the color of objects may be missing or limited, so objects can look miscolored or dark. That's why the color rendering index was created for light bulbs, as @ChrisH mentioned in a comment. This video linked by @eyeballfrog in a comment does a great job illustrating the difference between true white light and RGB white, and the effects.

Examples of how external RGB output can manipulate your brain

Your brain deals with an abstraction of reality. If necessary, it extrapolates what a color combination should look like, even if you have never seen that combination in real life. For example, yellow and blue light combine to produce white, so you can never see the (additive) color yellow-blue in real life. But if you view yellow light in one eye and blue light in the other, you can trick your brain into inventing the color yellow-blue (which looks like a combination of what yellow and blue each look like, not green).

So how can you create white light by combining only red, green, and blue light? You don't. It's an optical illusion. If you provide your eyes with red, green, and blue light, your vision system reacts with the same response as to white light, so your brain interprets it as white.

How can mixing red light and green light produce yellow light? It doesn't, it's another optical illusion. The medium and long wavelength cones are sensitive to ranges of color that straddle the yellow wavelength. Yellow light triggers both kinds of cones, and that ratio of activity is interpreted as having been caused by yellow light. But the raw signal that is being interpretted is that both the medium and long wavelength cones have been stimulated. Instead of yellow light, those two cones can be similarly stimulated by the right combination of red light plus green light. The cones don't know what part of the light spectrum did it, and your vision system interprets it as yellow.

## What makes RGB the "cone code"?

I'll circle back to elaborate on what makes RGB the cone code.

The vision system deciphers color via how the cones respond to it. It is able to discern and differentiate every color in the visible spectrum because every color stimulates a unique pattern of cone responses. It also isn't a mix and match, where the response patterns are unique but"random", and the vision system matches them to a table of colors. As you move across the spectrum, the cone output patterns follow smooth, complex curves that the vision system is designed to interpret.

Colors that are close to each other on the spectrum produce output patterns that are similar, and the perceived colors look similar. The spectrum looks like a rainbow because as you move across the wavelengths, the color we perceive follows the pattern, with one color blending smoothly into the next to form a continuum of hues.

The vision system cares only about the net output of each cone, it doesn't care how the cones got stimulated to produce that output. Intense light of a wavelength near the tail of the sensitivity distribution can stimulate the cone to the same output as weak light of a wavelength near it's peak sensitivity.

This was adequate during evolutionary times because everything was illuminated by broad-spectrum light (the sun, fire, etc.). The vision system could assume that the cones were all responding to the same distribution of light wavelengths. It only needed to compare the cones to each other to interpret the output.

With modern technology, we can fool the vision system to perceive colors by artificially stimulating the cones with the right wavelengths and intensities on other parts of their sensitivity curves to produce the same output pattern.

The problem is that for most of the spectrum, two or three kinds of cones will be stimulated by whatever wavelength you use. For example, when using a combination that includes reddish light and greenish light, the reddish light will stimulate both the M and L cones to some extent, and the greenish light will also stimulate both the M and L cones to some extent.

The output of each cone reflects its total stimulation. It becomes a puzzle to pick the right combination of wavelengths and intensities so the net stimulation of each cone matches its response for the intended color.

For most of the spectrum, you could find multiple combinations of wavelength and intensity to evoke a particular color. But what if you want to evoke all possible colors using the smallest number of triggering wavelengths, varying only their intensity (i.e., primary colors)? One requirement is that you would need to use a set of wavelengths that allows each type of cone to have the strongest response on at least one.

Looking at the sensitivity curves, that would require at least a wavelength in the blue range for the S cone, a wavelength in the greenish range for the M cone, and a wavelength in the reddish range for the L cone.

But that's not sufficient, there are requirements for the response patterns of each cone compared to the others. Varying only the intensity of each fixed, component wavelength needs to produce a cumulative response matching not just a single color, but all of the patterns for the spectrum. The results also need to be a continuous progression of color as you increment the intensity of a component wavelength.

That's a lot of complex requirements and constraints. But there happen to be "Goldilocks" spots in those three color ranges that allow you to use just three wavelengths to simulate most of the spectrum.

Because each selected wavelength needs to influence multiple cones for this scheme to work, the selected wavelengths can't be at the extremes of the visible spectrum, where a single type of cone is responsive. The bluest blue this can evoke is the selected blueish wavelength at 100% intensity, and the reddist red it can evoke is the selected reddish wavelength at 100% intensity; this trick can't evoke colors farther out on the spectrum. Thus, the gamut of RGB primary colors can't include the entire visible spectrum.

## CMY

Since RGB models how our brains process additive color, CMY (the color space), is an extrapolation of it for subtractive color. It just works in reverse using the RGB primary colors (note that CMYK is a different conversion).

In this chart, "nothing" is the absence of color being contributed. On an RGB device, "nothing" would appear as the background color of the device, which might not be pure black. On a CMY application, "nothing" would be the background color of the media, which might not be pure white.

Theoretically, every color in one model can be expressed in the other; one is just the inverse of the other. In real life, colors created from CMY primary colors are often muddy, not like the equivalent RGB color that the model suggests. The model isn't wrong.

The problem is with how the colors are implemented. There are issues like the colors being created by mixing pigments, or colorants that aren't a pure color, so you don't get pure subtractive color. When CMY colors are created, the conversion is much more complex than the chart above describes because of the need to compensate for real life considerations like available colorants and how they behave. But that's a subject for another question.

• That's a nice, and comprehensive, answer, so I don't suggest adding this, but the complexity is hinted at by light sources with narrow emission bands (e.g. sodium street lights and non-white LEDs) especially in combination with materials that have narrow transmission or reflection bands (some pigments/dyes, both natural and synthetic). This leads to the concept of the colour rendering index for lights Apr 6, 2022 at 6:30
• This youtube video does a great job illustrating the difference between true white light and RGB white. Apr 6, 2022 at 12:09
• "Every color in the visible spectrum stimulates either two or three kinds of cones to some extent" — at the ends of the visible spectrum we mostly get stimulation of one kind of cones. In particular, at 400 nm the ratio of sensitivities (normalized to peaks) of S to M cones is about 25, while at 800 nm similar ratio of L to M is about 11. (Numbers taken from 2° LMS fundamentals available here). Apr 6, 2022 at 12:57
• I think this may be simplifying it too much, "Red, green, and blue are the color components that your vision system uses to encode color information;" The way our vision system encodes color information is a bit complicated and I don't understand it very well, but we start with the LMS signals from the different cones and produce different signals (opponent or complementary, or something else) derived from those, and I don't think at any point we can really say that the signal is encoded as "RGB". Apr 6, 2022 at 17:59
• Yes, I know. I don't think an answer to this question can be considered complete, without mention of the CIE colour diagram. @MarkRansom Apr 7, 2022 at 0:54

I'm the author of this image that was used in the top-voted answer:

and I do not endorse that answer. (It's been edited, and I haven't looked at the edit yet.)

I made that image to disabuse people of the misconception that we see RGB. People commonly say that the three types of cone "detect red, green, and blue light", and you can see in the image that that isn't true at all. The other answer acknowledges that discrepancy, but saves the misconception by modifying it slightly into a form where postprocessing in the brain turns the cone responses into RGB. That's still wrong. RGB is not the internal color space of the brain.

(That should be obvious, because which RGB would it be? There are many sets of additive primaries called "RGB", including CIE RGB, Adobe RGB, Rec.601, sRGB, and Rec.2020. Today, sRGB dominates, but that's for reasons of engineering and interoperability, not because it matches the brain's internal color space more closely than the others.)

It's true that there is a three-dimensional space of psychological colors, because there are three cone types. It's also true that the brain transforms the cone outputs into a different "coordinate system". But it isn't RGB. The internal color axes seem to be dark/light, red/green, and blue/yellow, as explained in Wikipedia's article on the opponent process. Here's a picture of the opponent colors from that article:

Note that there are four opponent hues, not three, and the three that most closely match the sRGB primaries don't actually match them very closely. The opponent-process blue is essentially sky blue, but the B of sRGB is quite violet, as you can see in this image where a rectangle of it is superimposed on a photograph of the sky:

The name RGV was sometimes used historically instead of RGB for three-primary additive systems.

So where do RGB and CMY come from?

First of all, you need at least three primaries to get good color, because with two primaries, you only have two parameters (the quantity of each one) and so you can't cover more than a two-dimensional subspace of the three-dimensional space of psychological colors.

With three primaries, you still can't cover the whole space, but you can cover a three-dimensional subspace at least. If the primaries are well spaced around the color wheel, then you can produce every hue. If they're saturated (far from the dark/light axis), then you can produce fairly well saturated hues.

Beyond that, it comes down to practical engineering issues: some pigments and phosphors are (or were) cheaper to manufacture than others. When you optimize subject to all of these constraints, you end up with red-green-violet(blue) for lights, or red-yellow-blue for pigments. The historical red-yellow-blue systems evolved into the CMY systems used in printing today. Here's a side-by-side comparison of the primaries from Moses Harris's "prismatic color wheel", drawn circa 1785, and an extreme close-up of CMY dots on newsprint:

More primaries are better. You can't reproduce every color with three. That's especially true of paints/inks, which are far more complicated than emissive displays like TVs, because the mixing behavior is nonlinear, and the appearance of the result depends also on the illuminant. Three colors is just the minimum that gets you acceptable results.

Red, green, and blue are the only (additive) colors that cannot be created by mixing other colors. What makes them primary colors, or even unique?

Nothing. You can make them by mixing other primaries, if you choose other primaries.

• The RGB model says red light plus green light produces yellow light. Each color has its own wavelength. How can combining two wavelengths produce a third, all in the same wavelength ballpark?
• White light is a collection of all the wavelengths of visible light. Red, green, and blue light are just three wavelengths. How can just red, green, and blue create all the other wavelengths in white light?

The primaries in RGB systems aren't wavelengths. Color vision has nothing to do with spectral/rainbow colors. (This is another common misconception, which often manifests as people claiming that magenta is "not a real color".) Color vision evolved for other reasons, and the appearance of the spectrum is an evolutionary accident. Yellow is between red and green in the 3D cone space, and also in the spectrum. Violet is between red and blue in the 3D cone space, but not in the spectrum. That doesn't mean anything. The spectral colors doesn't matter.

Here are the wavelength spectra of primaries from particular CRT, AMOLED, and LED-backlit LCD displays:

None of these violate the sRGB standard, as long as they result in the same tristimulus values (up to overall brightness). This is something that fixer1234's answer basically gets right, except that it's couched in the idea that RGB is the brain's internal color space, which is wrong. What matters is only that the internal color space is three dimensional, while wavelength space has a much higher dimension (theoretically infinite), and as a result you have a huge freedom in choosing wavelength spectra that will map down to the same 3D point.

So how can you create white light by combining only red, green, and blue light? You don't. It's an optical illusion.

This is just wrong, unless you specifically define white to be the spectrum of sunlight. Even then, you could engineer a sRGB-compliant display whose primaries added to a close approximation of sunlight when displaying white, if there were any reason to do that. You can see from the graphs above that the output of real displays when displaying white is actually a pretty broad spectrum. The (AMO)LED display has the narrowest peaks, unsurprisingly, but even those are pretty broad.

A big part of the problem is that the same words that describe psychological colors are also used to refer to spectral frequencies. "Combining only red, green, and blue light" sounds like a spectrum with three sharp spikes, but it's not. The word "only" shouldn't be there; there's no "only" about it.

Since RGB is how our brains process additive color, CMY is an extrapolation of it for subtractive color. It just works in reverse using the RGB primary colors. [...]

The theory of mixing pigments is much more complicated than the theory of mixing lights. Even in the simplest model, the absorptive effect of different pigments doesn't subtract, but multiplies (or adds logarithmically). As a result the perceived color depends nonlinearly on the amount of each pigment, in a way that can't be modeled by tristimulus values. It also depends on the illuminant, which is a complication that doesn't exist in emissive color (though ambient lighting conditions do affect how colors from emissive displays are perceived).

So it is not at all true that CMY is the opposite of RGB. This is another weirdly common misconception. If you do a web search for "RGB CMYK conversion" or words to that effect, you'll find innumerable sites that literally just compute K = 255 - max(R,G,B), C = 255 - K - R, etc. I'm amazed that anyone really believes that CMYK is that simple: if it were, why even bother to define a separate standard? You could just compute 255-R in the printer.

• Thank you so much for posting this, it clears up a lot. Apr 7, 2022 at 20:16
• Thanks for this answer. I'll just post some thoughts. We can discuss in chat if you want. Key points: 1)My original writeup did incorrectly describe RGB as the internal color space. That's been corrected. What's described now is how RGB acts like a cone code to evoke colors. 2)We still don't know the internal color system for sure. The opponent process has fallen out of favor because of certain inadequacies. (cont'd) Apr 8, 2022 at 1:00
• 3)For the purpose of creating color in the real world, there are various versions of RGB, and added primaries for a better gamut, various CMY variants, including added primaries, use of alternative primary combinations as long as they can produce the desired color subset, adjustments for pigments, etc. From a basic color theory perspective, what is typically used to describe the visible color space (to the extent it can, as generically close as possible to vision, with 3 primaries that add up to white or black), is RGB for additive color and CMY for subtractive color. (cont'd) Apr 8, 2022 at 1:01
• Are you saying there is no basis for that; if people had understood color better, there might be a different combination being taught? Is RGB the primaries in emissive displays only for a reason like it happens to be cheap to make those colors? 4)"The primaries in RGB systems aren't wavelengths. Color vision has nothing to do with spectral/rainbow colors." The gamut perimeter is defined in terms of wavelengths, and the corners of the triangle have to be defined. Color vision is based on how light wavelengths trigger cones, and RGB display colors need to be precise wavelengths. (cont'd) Apr 8, 2022 at 1:01
• Having a tough time on this one. 5)'"Combining only red, green, and blue light" sounds like a spectrum with three sharp spikes, but it's not.' In practice, emissive displays aren't narrow peaks. But my understanding is they could be, and they would still fool the cones and produce a similar result. 6)CMYK is a different conversion than CMY, but the theoretical conversion for CMY actually is as simple as 255-R. That's not adequate in the real world, like for printers, because printers don't use perfect colors or processes. Apr 8, 2022 at 1:02

As a follow up to fixer's answer, there's no specific wavelength of R, G, and B that have to be used. They are chosen to get the largest possible range of what we can see.

Also, as pointed out by benrg, the R G B values are not wavelengths but colors. Two spectrum that produce the same color would be equally valid (ignoring the effects on reflections and refractions)

If you pick specific values for Red, Green, and Blue you define an Absolute color space https://en.wikipedia.org/wiki/Color_space#Absolute_color_space

If you look at this chart of various RGB color spaces there's quite a few choices. https://en.wikipedia.org/wiki/RGB_color_spaces

It should also be possible to intuitively see why a triangle made of different colors than Red, Green, and Blue would be inefficient and leave out colors that we can see.

Note that even the bigger RGB color spaces do not capture everything.

• Thanks for adding this to the discussion. One question for clarification. re: "there's no specific wavelength of R, G, and B that have to be used. They are chosen to get the largest possible range of what we can see...the exact RGB values have bounced around quite a bit" - can you distinguish between "internal" and "external"? Vision is based on physiological characteristics that don't change, so there must be precise primary colors for that system for interpretting light input. People have played with defining the corner points to create the biggest gamut that a RGB color space can describe. Apr 7, 2022 at 15:05
• I'm not totally sure what you mean by Internal vs External. Primary colors are just a a limited set of colors that can be mixed to produce all others. In theory, a D65 white in SRGB would look the same as the white in Adobe RGB even though they are a different mix of different wavelengths Apr 7, 2022 at 15:34
• @fixer1234 There are actually no three primary colors that would create all colors from the visible spectrum just by simple addition - any choice would need negative components for some colors. See feynmanlectures.caltech.edu/I_35.html Apr 7, 2022 at 15:50
• I guess the distinction is "produce" vs "interpret" (primary colors aren't just for production). The vision system interprets incoming light in a way fixed by phisiology, based on some primary colors defined by the vision system. People also produce colors using an RGB color space, and have experimented with the points of the triangle to maximize that gamut. RGB isn't a perfect explanation of how vision works. But to the extent that it is, the primary colors it uses don't change. Internal vs external referred to how your body interprets color internally vs how you create colors externally. Apr 7, 2022 at 16:09
• @fixer1234 There are no primary colors defined by our vision, only approximations. If you pick any 3 colors, you can mix them to get any of the colors inside their triangle but you can't get anything outside the triangle. And if you pick primaries that are outside the visible range, like ProPhoto, you can't make a device to display them because those primaries are invisible and won't generate any reaction in your eyes at all. Apr 7, 2022 at 18:41