25 Latest Videos

Color Channels and Color Theory

Posted on Thursday, May 22, 2008:: 4208 Views



First...A Little Color Theory


color wheel chart

Before we dive into channels, we need to look at a little color theory. The three primary colors of light are red, green and blue. To those of you who've ever taken an art class, this might come as quite a shock, because it certainly doesn't match up with the three primary colors of pigment which are: red, blue and yellow.

Color light theory is an "additive" process. When you mix, you add color to get white (which is made of every color). Every color we see is made up of a combination of red, green and blue light. In Photoshop, while working in RGB, an equal value of 255 for red, 255 for green and 255 for blue (max saturation of all three color channels) gives you pure white. A value of "0" for all three color channels will give you black, whereas an equal value of anything between 0 and 255 will give you a shade of gray (e.g. 80 red, 80 green and 80 blue will give you a dark gray).

This is very different from color pigment theory which is a "subtractive" process. As you mix pigments, you subtract color until you get black. So if you're mixing a bunch of paint together, you're going to get a dark, grayish-brown color until you ultimately arrive at black.

This is why when we're dealing with color correcting our digital images, either from our cameras, or even a flatbed scanner, it's vital that the old "art class" color pigment wheel get thrown out. For example, when correcting an image that is too red, we would add cyan, the opposite of red light, NOT green, which is the opposite of red in pigment theory.

Note: This entire article assumes that you are working in RGB.

Notice the RGB color wheel above. The three full circles represent the three primary colors of light; red, green and blue.  Where the circles intersect and mix, we get the three lighter, secondary colors of light; yellow, magenta and cyan. Where all the colors intersect in the middle, we get white. In color light theory, white is all colors while black is the absence of color.

If you move diagonally downward from red, you see that the opposite is cyan. Magenta is the opposite of green while yellow is the opposite of blue.

You might have noticed the numeric values next to the color wheel above. Photoshop assigns each pixel a value of 0 - 255 for red, green and blue. The red circle, for example, contains pixels that all have an RGB value of 255, 0, 0, meaning red is at max saturation (255) while blue and green are completely absent ( both at 0). When you mix 255 red and 255 blue, but 0 green, you get magenta. 255 red and 255 green, but 0 blue, will give you yellow. 255 blue and 255 green, but 0 red, will give you cyan. So what does all this amount to? We're essentially channel mixing here. I know Channel Mixer might be a bad word in some of you're vocabs right now, but later on channels will make much more sense. 


The Info Palette in Photoshop can tell you the RGB value of any pixels in your images. Simply hover the mouse over your image and look at the RGB values in the Info Palette (see below).

green leaves image info palette in Photoshop Notice that the green value is the largest at 165. Makes sense considering we're looking at a very green leaf. Blue is not very present with  a value of 67 while red is even less present with a value of 59.


Introducing...The Color Channels

If we take what we've learned so far and apply it to the channels palette in Photoshop (using the primary colored circles graphic below), we begin to see just what is really going on in the heretofore mysterious Photoshop palette that we call Channels.

First things first, yes, your color image is made up of three separate black and white images (more on that later). The Channels palette contains four channels, with the fourth channel, the RGB channel, being just a composite of the red, green and blue channels. Look at the diagram below. Right off the bat we can infer that the red, green and blue circles in the first graphic are full red, full green and full blue. Why you ask? Let's first look at the red circle and the red channel. The corresponding red circle in the red channel is white and the remaining green and blue circles are black. This must mean that red is at 255 while green and blue are at 0. It's the same for all three circles. So when looking at an individual channel, we now know that all white equals full saturation for that color. This makes sense because, thinking in black and white terms, with 256 shades of gray from 0 to 255, we know that white is 255. So a red value of 255, in the black and white image of the red channel, will be white.

rgb circles red channel circles green channel circles blue channel circles
circles rgb channels red channel green channel blue channel

 


Now let's take some more of our newfound color theory knowledge and apply it to the secondary colors shall we? First thing to remember before we look at the channels for our secondary colored circles image, is that we're still working in RGB, so we're still dealing with the red, green and blue channels. Now, having said that, you can see that the red, green and blue channels are basically opposite how they appear in the channels above. So let's disect this new phenomenon using the knowledge that we already have.

The cyan circle appears black in the red channel, and the magenta and yellow circles appear white. We'll look at the white circles first. To make magenta, you take 255 red, 0 green and 255 blue. So in the red channel, the magenta circle will be white because it contains full red. To make yellow, you take 255 red, 255 green and 0 blue. So once again, in the red channel, the yellow circle will be white because it contains full red. Cyan, however; is 0 red, 255 blue and 255 green. Therefore, in the red channel, the cyan circle appears black, because it contains 0 red.

Are you still with me? Trust me, this will all make sense. I'm just being extra analytical. Basically, the same still applies to the secondary colors below in the red, green and blue channels as it does in the primary colors above. If the pixels contain full saturation (255) of a color, that color will appear white in the black and white image of the respective color channel, even if the color is a mix of two channels. The magenta circle contains full red and full blue, so in the red and blue channels, it will appear white. In the green channel, the magenta circle will be black because it contains 0 green. Starting to see how the opposite secondary colors interact with their respective primary colors?

cyan magenta yellow cyan circle magenta circle yellow circle
rgb channels red channel green channel blue channel


Color Channels And A Real Life Image

Now let's take a look at an actual color image.

orange cat image red channel cat image green channel cat image blue channel cat image
rgb cat image channels red channel green channel blue channel
 As I mentioned earlier, the RGB channel is simply a composite of all three channels and will show you your color image as it actually appears. Looking at the cat in the red channel, we see that the fur is very white, so in the full color image, it should be either red or yellow (or orange). A quick glance shows us that the fur is indeed very reddish-yellow, and because it is so white in the red channel, we can assume that there is almost full red in the fur. Incidentally, orange has an RGB value of 255 red, and 150 green.  If you were to look at the info palette in Photoshop, you would see that the orange parts have a value of approximately, 240 red, 149 green and 30 blue. The object the cat is sitting on is basically solid black in the red channel, which can only mean that there is zero red in that part of the image. Much of the fur in the green channel is very light, with some of it being almost white. So shouldn't the very light parts be green in the final image? Nope, because those light parts in the fur in the green channel are yellow in the final composite. Yellow is made up of red and green, and since the fur is so light in parts, we can assume that there is full red and full green. As I mentioned in the red channel, the orange in the fur contains about 150 green, which is why most of the fur in the green channel is on the lighter side, but not full white. The blue channel shows a very different black and white image. The dark, almost black stripes in the fur contain almost no blue values at all, hence the dark appearance in the blue channel. The object the cat is sleeping on, however; is solid white, and we can see in the full color image that it is indeed very blue. 

 


Typically, the green channel will look the most "normal" to our eyes. That's because the little cones in our eyes that are sensitive to color, are most sensitive to green light. There are several spots in the image that appear white in all three channels (most notibly the highlights in the metal object). These areas contain full red (255), full green (255) and full blue (255). As we know, an RGB value of 255, 255, 255 means white, since white is made of all colors.

Let's talk about neutral tones for a moment shall we? We know that an RGB value of 255, 255, 255 is white, and an RGB value of 0, 0, 0 is black (no color at all). But what about the neutral grays? Basically, when something is said to be neutral, it will have similar RGB values  in all three channels ranging from anywhere between 0 and 255. So an RGB value of 1, 1, 1 is a very dark gray (at those numbers it might as well be black). A more typical neutral gray is 128, 128, 128 which is considered middle gray. I took a reading from the info palette of the gray tarp behind the cat and got an RGB value of 166, 162, 161, which is pretty darned close to being neutral.


A Black And White, Color Image?

By now you've probably accepted the fact that your full color image is actually three separate black and white images. But how in the world do we get the final color image then? Photoshop basically sees a black and white image. But it also sees it through three different colored filters (channels); red, green and blue, much like your camera. In fact, your camera has  tiny little red, green and blue filters that sit over the pixels in the sensor. So light hits the sensor, and passes through the red filters, the green filters and the blue filters. It's then up to the camera to interpret what colors should be in the final image by a process of interpolation called demosaicing. But that's a whole 'nuther can o' worms.

As I mentioned earlier, the channels palette in Photoshop gives you a view of each of these black and white images. Photoshop then takes the red channel, green channel and blue channel values (ranging from 0 - 255) and creates the full color composite. Of course, I've just greatly over simplified the entire process.

So let's dive deeper in since we've already got our feet wet. Say you have a gray pixel in the red channel that has a value of 20. It's pretty dark in the red channel. That same gray pixel in the green channel has a value of 150 and appears relatively light. The same pixel in the blue channel has a value of 200 and is very light. So together, we have an RGB value of 20 red, 150 green, and 200 blue. That color, once it's composited and described to Photoshop as an RGB value, is a light cyan-blue color, probably found in a sky.


 

 orange cat

Let's look at an extreme close up of a cross section of the orange cat's fur in the image above. Each shade of gray has a numeric value from 0 - 255. Combining all three values for each pixel from each color channel is how Photoshop "describes" what color we should be seeing. Notice the white pixel (square) in the lower left corner. See how that pixel has a value of 255 in all three color channels? Several shades of the orange pixels contain full red (or, 255 red). In the blue channel the orange pixel in the upper left and the darker orange pixel in the center both contain no blue at all, hence the black pixels in the blue channel.

 

orange patch red channel cross section green channel cross section blue channel cross section
 RGB Composite  Red Channel  Green Channel  Blue channel


channels chart  Think of your color channels as three separate filters; red, green and blue. As light passes through and mixes with each "filter"/channel, you get a full color image. Remember, every color we see is a combination of red, green and blue light.

So What Can You Do With Your RGB Color Channels Anyway?

So, this is all fine and dandy, but what can you actually do with channels and how can a decent understanding of the color channels factor in to your workflow? Aside from having a better understanding of how Photoshop sees color images (in RGB anyway), it's possible to color correct individual channels, eliminate color casts in a specific channels, apply most filters to any channel for some cool effects (including infrared effects), use channels to remove a background, and even save selections for later use (more an alpha channels later).


Chances are good that you've performed a color correction, at some point in time, directly on one of the color channels, whether you realized it or not. In fact, everytime you use Levels or Curves to correct color, you select the specific color channel you want to affect. Too much red in the midtones? Select the red channel in Levels and slide the midpoint slider to the right, decreasing the red in the mids. Of course, this will make the mids more cyan.


Let's take a look at correcting a slight color cast in the red channel.

red channel girl image red channel levels red channel girl cyan cast
Although it's hard to tell from just looking at the image above, there is actually a slight color cast in the highlights. If you look at the histogram for the red channel in the Levels palette in the image to the right, you'll notice some clipped reds on the right side. Most of the face in the red channel's black and white image is blown out. Working directly on the red channel in the channels palette, I've adjusted the midpoint and the max red (output) in Levels. By setting the output slider to 240, I'm saying that max red should now be around 240 instead of 255. This is going to darken the highlights in the red channel's black and white image. In the final, composite color image, this is going to translate as more cyan in the highlights. I've over adjusted the red channel just slightly so you can see the difference between this image, which contains less red and more cyan in the highlights, and the image on the far left which has that slight red cast.


So we now know that when you adjust a specific channel in Levels or Curves, you're really adjusting the brightness of certain pixels in that particular black and white image. In the final composite, however; this translates to a shift in color. Say you're adding yellow to "warm up" a cool image in the blue channel in Levels, you're really darkening areas in the black and white image in the blue channel. When you work with Levels or Curves, you're seeing the final color image, so when you make your color channel adjustments, you see the color shifts you're trying to achieve.


While it's possible to work directly on a channel, it's a destructive process. So once you edit a channel using something like Levels, that's it. Of course you can try and edit the channel back to some semblance of how it originally appeared, but keep in mind, the more you edit your image, the less tonal information you retain, until posterization or some other unpleasnt artifact manifests itself. red channel bw girl image red channel
It's much better to work on a channel inside Levels in an adjustment layer. You can achieve the same result, and still go back in and fix things later if need be. full color red channel girl levels adjustment layer


Fun Things To do With RGB Color Channels

So far, all of this sounds very technical. But no one said you couldn't have a little fun with channels also. Click each thumbnail below to view a short video of some of the fun things to do with RGB channels.

channel grain street scene filtered channels
 Noise was added to each channel individually, in slightly differing amounts, to add a very realistic film grain. A channel mixer adjustment layer was then added to convert the image to black and white. You can use Channel Mixer to create infrared effects.   This image has two layers. The bottom layer is the untouched original, color image. The top layer is a duplicate. In the channels palette for the top layer I simply applied a guassian blur to the blue channel only. I then desaturated the layer and lowered the opacity to about  75%. The end result is a cool desaturated look with a unique soft focus look.


Aplpha Channels? What The Heck Is An Alpha Channel?

I mentioned "Alpha Channels" earlier. Ever trashed an object in Photoshop only to regret it later on when you needed to load it as a selection? With alpha channels, you can save a selection to use later on. An alpha channel is nothing more than a grayscale mask that can be edited in the channels palette. You can save alpha channels with your file as long as the file is saved as a PSD, TIFF, PDF, PSB or PICT format.

To save an alpha channel is really very simple.

text selected save selection name alpha channel text alpha channels
Command click (CTRL for PCs) the object's thumbnail in the layers palette to load it as a selection. In this case it's a bit of text.  Then, go to Select > Save Selection. Name the alpha channel. Here I've chosen to call it "text alpha".  The new alpha channel appears below the three color channels. The Command shortcuts to the right of the channels will select each channel individually.
 


text channel text mask text selection
 Selecting a saved alpha channel in Channels will show you the grayscale mask pictured to the right. When viewing an alpha channel in the channels palette, everything in black is the mask around the selection, which is the white portion. In other words, the white areas represent the selection while the black areas are everything outside the selection.

You can CTRL click (Cmd click for Mac users) on the alpha channel thumbnail to load it as a selection when you go back and view the full composite image in the Layers palette (pictured above).

 

*Note: You can also load a selection by going to Select > Load Selection.

 


bride selected bride selection refined bride alpha channel
Alpha channel selections can also be more complex. Here I've selected the bride with the quick selection tool in Photoshop. I then used Refine Edge to feather and contract my selection a little. The alpha channel that I saved is a slightly feathered mask.

 

oval selection oval alpha channel blue oval
Here I created an oval selection that is feathered by 10 pixels. I then saved it as an alpha channel. You can see the feathered edges in the alpha channel. The area in white will be the inside of my selection when I load this alpha channel as a selection. With the "a" alpha channel loaded as a selection, I filled the selection with blue in the layers palette, leaving me with a feathered, blue, oval frame.

 


Alpha channels can also be used as texture channels in Photoshop's Lighting Effects Dialog.

epp channels texture channel epp lighting effect epp image
 Here I've got an alpha channel called epp-alpha. Under Filter > Render > Lighting Effects, you can use an alpha channel as a background texture. I've selected my epp-alpha alpha channel to be the background texture. I then positioned the lightsource above the texture.  This is the resulting graphic.

 You can use channels and alpha channels to separate your subject from the background.

original hooded girl image duplicate channel blue channel copy
 Say you want to select the girl in this image and separate her from the background. The fibers in the hood are proving to be too difficult to select with the quick selection tool, and you haven't quite mastered the Extract filter yet. Here's a cool technique using channels and alpha channels that should make your life easier.  1. In channels, you want to choose the channel with the most contrast between the subject and background. Here I've chosen the blue channel because the bulk of the background was already black and there is a very clear delineation bewtween the subject's hood and the background. Then drag the blue channel to the Create New Channel button to duplicate it. 2. The Blue copy channel is now going to be your alpha channel that you will use to separate the girl from the background. 
painting black blow out highlights paint white
 3. Paint with black over all the areas around the subject. Remember, alpha channels are grayscale masks, and behave exactly like layer masks. So all the areas you paint in black will fall outside the selection.   4. Next, bring up Levels and tweak the highlights (purposely blow them out) so that there is more separation from the black background.  5. Inside the subject, paint the rest white. Again, since this is like a layer mask, everything inside the white area will be selected.
girl selected refine edge girl separated
 6. Next, Cmd (CTRL) click the alpha channel to load it as a selection, click the RGB channel to view the full composite, and go back to layers. The subject now has a selection around her. 7. You can use Refine Edge to improve your selection.   Voila! Cmd (CTRL) J to put the subject on a new layer.



<< Back to Articles Index


Related Articles:

Anatomy of the Histogram
Posted on Monday, June 22, 2009 :: 2877 Views

Images and Their Histograms - Examples
Posted on Tuesday, July 22, 2008 :: 2355 Views

Filenames and sorting
Posted on Friday, February 08, 2008 :: 999 Views

Understanding Resolution Part 1
Posted on Monday, January 28, 2008 :: 1202 Views

Understanding Resolution Part 2-Resampling
Posted on Sunday, January 27, 2008 :: 1170 Views