sandra_henrystocker
Unix Dweeb

Alice in Colorland: RGB vs CMYK

Analysis
Mar 31, 20105 mins

Scrunching my face at the differences between the image on my screen and the printout on the paper in my hand, the reason for the two systems commonly used for generating colors — RGB and CMYK — finally hit me like a chessire cat landing with a thud on the top of my head.

RGB, the color system that I spend most of my time fooling with, is based on the three colors of light that can be used to create virtually any color. This “additive” color model creates yellow by mixing red and green unlike the “subtractive” color model that I discovered as a kid with my crayons in which I could create green by mixing blue and yellow or orange by mixing yellow and red. I made peace with the dichotomy of two sets of primary colors (red, green and blue or red, yellow and blue) — one used for light, the other pigment — decades ago. Then came CMYK.

CMYK is another subtractive color model. As when I was working with my crayons so long ago, I can combine its yellow and its blue-like (cyan) to create green, but the similarity ends more or less right there. For red, I have to mix yellow and magenta. Huh? Unlike the color systems that have come to make sense to me, the CMYK model has as its primary colors cyan (a light greenish blue), magenta (a purplish pink), yellow and … black! Why black? Because no amount of mixing cyan, magenta and yellow will give you black. A muddy brown is the closest you’ll come. And, while, the RGB model easily produces nearly any color you can imagine, the CMYK system is trickier to work with and far brighter people than I have tried to come up with ways to convert between the two. Even so, the translation is imperfect. The disparity between the image on my screen and that on the sheet of paper in my hand was testament to the difficulty of the conversion algorithm.

Black is easy for RGB. In a system in which colors are created by altering the intensity of three colors, no color at all is black. Maximum intensity of all three colors is white. Equal amounts of the three primaries (but more than nothing and less than maximum), gives you a large palette of shades of gray.

In RGB, each color is achieved by some combination of the three primaries. For 16-bit color, we might have five bits to represent 32 intensities of red, another five bits to reprsent 32 intensities of blue and six bits to represent 64 levels of green. That’s 32 * 32 * 64. This system yields 65,536 unique colors.

If you use 32-bit color, you might have more than 4 billion colors (depending on whether each primary is given 8 bits or 10-11. Even higher depth computer screens are possible — such as 40-bit and even 64-bit color, but the ability of the human eye to detect differences between more than nine quintillion colors is highly doubtful!

The CMYK system is used for printing while RGB is used, of course, for screens. The choice of these particular colors is no accident, as you might suspect. They are, in fact, the secondary colors of light much as orange, green and purple are the secondary colors of pigment.

The number of colors that CMYK delivers depends on the mechanism that printers use to place tiny amounts of toner on the page in close proximity, thus tricking the human eye into “seeing” a blend of the applied colors. The number of colors is then tied to the number of combinations of the cyan, magenta, yellow and black dots you can fit into a small enough area that the dots merge into a particular perceived color. This number is a lot smaller than 65,536, never mind none quintillion. Most graphic designers work from a palette with one or two thousand predefined colors called the Pantone Color Matching System.

An exception to the “color by dots” method of printing is accomplished when professional printers use “spot color”. In spot color, the required colors are mixed ahead of time, so that the printers work with solid colors, not interwoven dots. For most folks, this works out just fine because the things that they are printing generally only use a few colors and, well, one or two thousand colors is still a lot to choose from if you’re designing a logo or printing business stationery. Full color printing is generally far more expensive than printing with two or three carefully selected colors.

Some friends of mine apply an algorithm when working online to get the color they want to see when they print. They make certain colors more intense on the screen so that they’ll come out of the printer looking as they should. For many of us, the differences between what we see online and on paper doesn’t matter much at all. For others, precise colors convey identity and nothing short of strict adherence is acceptable. Curiouser and curiouser!

sandra_henrystocker

Sandra Henry-Stocker was a programmer, Linux systems administrator, security engineer and Linux journalist for most of her 30-year career. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders. Tune into her 2-Minute Linux video tutorials and take command of your command line.

More from this author