# Primary Colors: RGB vs. Red-Yellow-Blue



## Janx (Oct 28, 2011)

In the vein of Bullgrit's science questions, here's a sciency question:

What's the technical cause of the difference between Red-Green-Blue being the primary colors vs. the "traditional" Red-Yellow-Blue that art uses.

As background: in TVs, LCDs, or just about anything electronic generating color, the 3 colors of Red, Green and Blue are used to generate any other color.

In art, the toilet (remember when You first learned Yellow and Blue make Green!), and even crayons, Green is the product of Yellow and Blue, not the other way around.

For art, it's not a simple chemical reaction (blue paint + yellow paint doesn't bubble up into green paint by way of chemistry).  You can get the same effect from urine + tidy bowl cleaner, or any kind of yellow and blue paint (using different chemicals to do so).  You can also lay 2 pieces of colored cellophane over each other and see the effect (no chemistry involved).

So, what's behind the difference in the primary colors? Why don't TVs do RYB?


----------



## Umbran (Oct 28, 2011)

Janx said:


> So, what's behind the difference in the primary colors? Why don't TVs do RYB?




The roots lie in how your eyes receive, and your brain actually perceives, light.  You've got a few different types of photoreceptors in your retina - rods for black and white vision, and cones for color.

You have three types of cones, which receive best in Yellow, Green, and Violet.  The differences between the levels of each that your brain receives can be used to interpret a wide variety of colors.  Say a few photons of blue light enter your eye - you don't actually have receptors for blue.  Your cones say that your Green and Violet receptors kicked off pretty strongly, and the Yellow weakly, and your brain decodes that as blue.

*Any* light that kicks off your yellow receptors weakly, and the other two strongly, will look "blue".  You may shine pure dim wavelengths of yellow, and strong pure green and violet, and your eye won't know it isn't actually blue. It is the relative levels that matter.  

So, any mixing plan that hits the same relative combination will get you the same perception of color.

RYB (what you learned in school with paints) is subtractive mixing.  You start with white light, and then take away wavelengths - start with white, take away some wavelengths, and what is left may not actually be photons in the green range of the spectrum, but your eye reacts as if it were.

RGB (what's used in video screens) is additive mixing.  You start with no light, and you add levels of various lights until you hit the characteristic pattern of firing cones.  Again, you may not be firing actually yellow light at the person, but if the relative pattern of firing neurons is the same, you'd perceive it as if it was yellow light.

RGB and RYB are by no means the only triads you can use.  And those triads can't actually reproduce all the colors humans can distinguish.  They are chosen because they are convenient and fairly effective at reaching most of what you can perceive, and are convenient for the technologies they're used with.


----------



## Bullgrit (Oct 28, 2011)

And don't forget CMYK (cyan, magenta, yellow, black) for printing colors.

Bullgrit


----------



## Janx (Oct 28, 2011)

Bullgrit said:


> And don't forget CMYK (cyan, magenta, yellow, black) for printing colors.
> 
> Bullgrit




which is kind of cyan = purplish blue, magenta = purplish red so it's a variant of RYB.


Good answer.  I'd give XP to umbran, but apparently I already approve of what he said sometime earlier.


----------



## Fast Learner (Oct 29, 2011)

Adding to the CMYK info, in theory you can use only cyan, magenta, and yellow printing inks to create any color, but the reality is the same as if you mix blue, red, and yellow paints yourself: no matter how you balance them, the darkest you can make them is a muddy brown. The black ink (K is for "key", though it's also a useful way to distinguish it from the B in Blue) is essential for getting truly dark and even black tones.

In printing, though one would think that 100% black ink provides a utterly deep black, the reality is that it's only a very deep charcoal color, one that can vary based on the desire to produce good looking photographs and flesh tones and such (ink densities are adjusted on the press at the beginning of the run and throughout to ensure that everything continues to look good). For that reason when preparing something for print you often create what's called a "rich black", a mix of black and the other three inks, to really deepen the color. The precise mixture can be varied in order to produce a "warmer" black (more magenta and yellow) or a "cooler" black (more cyan). While one might propose using 100% of all four colors to create the deepest possible black, on the press the paper gets far too wet when there's so much ink applied, either warping the paper or having the ink transfer to other stacked sheets before it gets a chance to dry.

The actual gamut (color possibilities) of CMYK inks are actually more narrow than it would seem. In particular you can't produce truly beautiful oranges and greens, something thats somewhat evident by the colors of the inks themselves, e.g. when trying to produce a great orange you'd mix magenta and yellow, but due to the somewhat blue nature of the color magenta, it never comes out truly orange. As a result several alternate printing systems have been developed. For a while Pantone's (major manufacturer of press inks) Hexachrome system was somewhat popular, which directly added orange and green, creating a CMYKOG system. Unfortunately it wasn't ever sufficiently popular (largely due to press limitations and Pantone's patent protection) and is no longer in use.

Lastly, what others have posted along with what I added here only barely touches the surface of subtractive and additive color. One primary reason is the fact that the human eye is actually pretty lousy at seeing a very large range of theoretically visible colors (stuff in the "visible light" spectrum, not down into infrared or up into ultraviolet). Another is that really no color model accurately reflects the possible colors that exist -- there's some seriously complex science involved. And finally, I brushed over the complexities of press ink and didn't touch stuff like under color removal, under color addition, gray component replacement, how halftoning dramatically affects what you can actually do, etc.

Crazy stuff!


----------



## TanisFrey (Oct 29, 2011)

color film photography used CMY (cyan - magenta - yellow) as subtractive filters for creating color prints.

Yes, I am showing my age.  I as process some film and prints by hand in a photography class in high school over 15 years ago.


----------



## Thunderfoot (Oct 29, 2011)

And in stage lighting any combination of three colors will get you an off white as long as they aren't part of the same color path on the color wheel. (i.e. pink rose and red will get you a very interesting red color.)

Straight white light from a spotlight is usually to harsh on the human eye and washes out the subjects so combinations of colors are used in stage lighting from different angles to achieve "white" light.  Which is why concerts and stage productions have so many different colored lights on while the stage appears "normal".  The color wash is only really used to indicate feel (red for anger or violence, blue for sadness or water effect, green for peace and outdoors, etc.)


----------



## Umbran (Oct 29, 2011)

Fast Learner said:


> Adding to the CMYK info, in theory you can use only cyan, magenta, and yellow printing inks to create any color




As I noted above, this is not true, even in theory.  For both subtractive and additive mixing, the three colors chosen define what is called a "color triangle", and only colors _inside_ the triangle may be created. Adding black does not change the colors that can be reached, but instead allows greater variation in overall saturation of color.


----------



## megamania (Oct 29, 2011)

My brain is going to BOOM



ouch.   too late



There are no easy answers anymore.   The more we learn the less ofan easy true answer we can give.


----------



## Umbran (Oct 29, 2011)

megamania said:


> There are no easy answers anymore.




That wasn't easy?  

The laws of nature have not notably changed over the course of human existence.  The answers have always been thus, we just didn't know it in the past.  They (at least the correct ones) haven't gotten harder.


----------



## megamania (Oct 30, 2011)

To me, an artist, it has always been Red, Yellow and Blue.

Then tinkering with printing I learned they use Magenta, Cyran, yellow and so on.


Then we get into the use of color spectrum with science.  How the color we see is the color of the light spectrum we are picking up, the rest are being reflected.  White = all colors are reflected and Black being all are absorbed.

Sometimes I miss the days of Red, Blue and Yellow was the only answer required.

But then again.... I'm something of an idiot anyhoo.


----------



## Janx (Oct 30, 2011)

megamania said:


> To me, an artist, it has always been Red, Yellow and Blue.
> 
> Then tinkering with printing I learned they use Magenta, Cyran, yellow and so on.
> 
> ...





Well, the principles are the same, 3 basic colors.  Mixing 2 of them in equal amount produces a secondary color (hence yellow+blue = green).  

Mixing 2 of them in unequal ammounts produces a variant of that secondary color or primary color of the greater quantity.

And so on.

The color wheel for paint works mostly like the color wheel for computers (RGB), except where the colors are is different (since one relies on Green, not yellow).

Umbran tackled the question I had, about the technical difference on Y vs G.


----------



## Fast Learner (Oct 30, 2011)

Umbran said:


> As I noted above, this is not true, even in theory.



I exaggerated, definitely not any color, I meant "all the colors you'd think you could create by mixing those three", and that the reality is that in order to actually produce vibrant-to-the-eye colors, together those three can't absorb all light if mixed in the right proportions.


----------



## Janx (Nov 1, 2011)

Fast Learner said:


> I exaggerated, definitely not any color, I meant "all the colors you'd think you could create by mixing those three", and that the reality is that in order to actually produce vibrant-to-the-eye colors, together those three can't absorb all light if mixed in the right proportions.




So I wonder what colors I'm missing.

In the right paint program, you can see all the combinations of the RGB color code (3 integer values ranging from 0-255 each in any combination).

It certainly LOOKS like all the colors.

Whats missing from it (aside from variant colors like a lighter than off-blue in my crayon case because I needed to have blue=12.5, etc).  Anything specific (like brown?)


----------



## Umbran (Nov 2, 2011)

Fast Learner said:


> I exaggerated, definitely not any color...




Yeah, sorry, when talking science topics, I sometimes tend lean heavily for technical correctness.


----------



## Cor Azer (Nov 2, 2011)

Janx said:


> So I wonder what colors I'm missing.
> 
> In the right paint program, you can see all the combinations of the RGB color code (3 integer values ranging from 0-255 each in any combination).
> 
> ...




Attached image shows this issue with using three primary colors - you can only really represent colors within the triangle.


----------



## Fast Learner (Nov 2, 2011)

Janx said:


> So I wonder what colors I'm missing.
> 
> In the right paint program, you can see all the combinations of the RGB color code (3 integer values ranging from 0-255 each in any combination).
> 
> ...




Unfortunately it's a bit tricky to describe, and as you can imagine, effectively impossible to show you since your monitor has the limits. This Wikipedia bit explains the basics.

The image that Cor Azer posted is one way of showing it. The colors outside the triangle all look like the colors inside it, which is the point: they'd look different if they could.

---

The human eye is the other limitation. The short, medium, and long cones in our eyes respond best to certain colors and not well to others. We're told in  junior high school (or so) that the short ones respond to blue, the medium to green, and the long to red, but it's more like this (the peaks are where those S, M, and L cones are most sensitive):






As you can imagine, it's very difficult to discern subtle differences between colors outside of those areas, though it's further complicated by both the clever tricks and limitations of our brains' processing. 

That, and that light levels have a big effect on what the eye perceives; when there's lots of light and we're looking directly at something we mostly use signals from our cones, but when it's dark or your brain is processing peripheral images it derives most of its information from our rods (of which there's basically one kind). I mocked up an image showing the colors our rods perceive using the pervious Wikimedia image as a base:






When it's dark our cones hardly fire at all, so we can only reasonably discern colors inside that zone. Our brains, though, fill in details for us, making us think we can see things we really can't. For example, if you saw a stop sign at night with very little light it would look red to you, but mostly because you know that stop signs are red; if I made one that was of the appropriate luminance (brightness) but was instead a green outside of your rods' detection zone you'd still think it was red.

My favorite image of all time that shows how your brain tricks you is this one:






The squares labeled A and B *are the exact same color and shade*. I had to test it in my image editor before believing it. You can see the same brain trick in action in this amazing YouTube video:

[ame=http://www.youtube.com/watch?v=z9Sen1HTu5o]Incredible Shade Illusion! - YouTube[/ame]

To sum, our eyes and brains combine to do amazing things that do not accurately reflect reality, though mostly to our benefit.


----------



## Jhaelen (Nov 2, 2011)

Janx said:


> Whats missing from it (aside from variant colors like a lighter than off-blue in my crayon case because I needed to have blue=12.5, etc).  Anything specific (like brown?)



There isn't a particular hue missing, it's combinations of hue, saturation, and lightness at the extrema of each 'axis'.

According to William Gibson's novel 'Zero History' Yves Klein Blue is an example of a colour that cannot be represented by computer monitors which I tend to consider likely.


----------



## Plane Sailing (Nov 2, 2011)

Janx said:


> So I wonder what colors I'm missing.
> 
> In the right paint program, you can see all the combinations of the RGB color code (3 integer values ranging from 0-255 each in any combination).
> 
> ...




For simpler examples of what is missing - think fluorescent colours or metallic colours.


----------



## Plane Sailing (Nov 2, 2011)

Janx said:


> So, what's behind the difference in the primary colors? Why don't TVs do RYB?




You've had lots of detailed technical answers, but the simple one liner (when you want to explain it to someone with minimum explanation) is this.

When you are mixing coloured lights you are using transmitted light, when you are mixing paints you are using reflected light


----------



## Crazy Jerome (Nov 3, 2011)

This conversation reminds me that I've lived through the computer conversions from the first desktops, to 8 bit, to 16 bit, to 32 bit, and now 64 bit. But now I can't remember if it was 16 or 32 that finally gave us more possibilities in color than the human eye could discern. I want to say 32 bit, the actual limit requiring the addressing space in what would be around 24 to 27 bit (depending upon who you asked at the time). I do remember that there was some discussion about the incredible waste of storage space that would happen, storing all those undistinguishable colors, each MB being precious. 

CJ - so old he can't remember when he got things he couldn't see.


----------



## Fast Learner (Nov 3, 2011)

I'm not aware of any systems that use more than 32 bits to store a pixel's color -- 64 bit processing is popular now, but the colors themselves are, as far as I know, stored in 24 or 32 bits, depending on whether they include transparency information.

8 red bits (256 levels) * 8 green bits * 8 blue bits = 16,777,216 possible colors, 24 bit color. For most colors this is beyond what humans can perceive.

Add 8 bits of transparency information (256 levels) = 4,294,967,296 possible color values, though still 16.7 million colors, for 32 bit color value storage.

64 bit color would allow for 16 red bits (65,536 values) * 16 green bits * 16 blue bits for roughly 281,474,976,700,000 colors; 281 trillion is certainly more than the human eye can detect and more than most (all?) instruments can detect. Plus 16 transparency bits (which actually would be nice) for roughly 18,446,744,070,000,000,000 combinations, 18 quintillion, which is just nutty.


----------



## Umbran (Nov 4, 2011)

Fast Learner said:


> 8 red bits (256 levels) * 8 green bits * 8 blue bits = 16,777,216 possible colors, 24 bit color. For most colors this is beyond what humans can perceive.




Yes and no.  That's 16 million + colors, but they're all within a range of chromaticity, an area of color space, if you will.  There are going to be colors outside that space that the red, green, and blue base you're working from simply *cannot* add up to make, ever.

The difference to many will seem negligible, I expect.  It may be functionally as good as anyone ever needs.


----------



## Fast Learner (Nov 4, 2011)

Right, that's why I said "for most colors": it doesn't include colors outside of that gamut. Fortunately most of the colors we can perceive are within the RGB gamut.


----------

