Thursday 1 March 2012

Photoshop Selections: The Color Range Command Photoshop Selections: The Color Range Command Photoshop Selections: The Color Range Command



Photoshop Selections Tutorials - Color Range

Photoshop Selections: The Color Range Command

Learn Photoshop with Photoshop Basics Tutorials at Photoshop Essentials.com

Summary: When it comes to making color-based selections in an image, most Photoshop users turn to the Magic Wand Tool because it's easy and it's right there in the Tools panel. But if you dig a bit deeper, you'll find the Color Range command, and in this tutorial, you'll learn why it's time to wave that Magic Wand goodbye!
Written by Steve Patterson
Exclusively for Photoshop Essentials.com.
Part of our complete collection of Photoshop Basicstutorials.
In this tutorial in our series on Photoshop Selections, we'll learn all about the Color Range command and why it's such a great tool for selecting areas in an image based on tone or color.
The Color Range command is similar to the Magic Wand Tool in that both are used to select areas based on tonal and color values, but that's really where the similarities end. The Magic Wand was first introduced way back in the very first version of Photoshop, and while it can still prove useful at times, it didn't take long for the folks at Adobe to realize they could have done better. In Photoshop 3, they introduced the Color Range command as a replacement of sorts for the Magic Wand. Yet for all its advanced features and flexibility, not to mention its vastly improved results, the Color Range command became nothing more than one of Photoshop's best kept secrets while the Magic Wand remained the tool of choice for most users.
In this tutorial, we'll learn why the Color Range command, not the Magic Wand, is the tool you should be using when making tone and color-based selections.
New! Download our Photoshop tutorials as convenient, print-ready PDFs!

Where To Find The Color Range Command

The first difference between Color Range and the Magic Wand is that Color Range isn't actually a selection tool at all, which is why you won't find it mixed in with the Magic Wand and the other tools in the Tools panel. Color Range is a selection command, and we access it from the same place we access other commands - the Menu Bar along the top of the screen. Go up to the Select menu in the Menu Bar and choose Color Range:
Selecting the Color Range command in Photoshop. Image © 2012 Photoshop Essentials.com
Go to Select > Color Range.
This opens the Color Range dialog box. If you've been using the Magic Wand for a while and are just now seeing Color Range for the first time, you may be thinking "Geez, no wonder most people still use the Magic Wand! What the heck am I looking at here?". At first glance, the Color Range command can seem a little intimidating. After all, with the Magic Wand, all we do is select the tool from the Tools panel and click on the image. But don't let first impressions fool you. Color Range is very easy to use once you know how it works (which, of course, you will after reading this tutorial!):
The Color Range command dialog box in Photoshop. Image © 2012 Photoshop Essentials.com
The Color Range dialog box.

The Select Option

Let's take a quick run through of some of the things we're seeing in the Color Range dialog box. We'll look at the most important options for now and save the others for a bit later. At the very top of the dialog box is the Select option. By default, it's set to Sampled Colors:
The Select option set to Sampled Colors in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
The Select option set to Sampled Colors.
The Select option controls what it is we'll be selecting in the image. With the option set to Sampled Colors, the Color Range command behaves much like the Magic Wand. We can select pixels that share the same or similar color just by clicking on an area of that color in the image. Photoshop "samples" the color we clicked on and selects all of the pixels that are the same as, or within a certain range of, that color (hence the name "Color Range").
In most cases, you'll want to leave the Select option set to Sampled Colors, but unlike the Magic Wand, the Color Range command gives us additional ways that we can select pixels. If you click on the words "Sampled Colors", you'll pop open a list of the different selection options we can choose from. For example, we can instantly select all the pixels of a specific color (reds, yellows, blues, etc.) simply by choosing that color from the list. Or, we can quickly select the brightest pixels in the image by choosing Highlights, or the darkest pixels by choosing Shadows. These additional options can come in handy in certain situations, but as I mentioned, for the most part you'll want to leave the option set to Sampled Colors, which is what we'll be focusing on in this tutorial:
The Select options in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Color Range gives us more ways to select pixels than what we get with the Magic Wand.

The Eyedropper Tools

When using the Magic Wand to select areas of similar color in an image, we click on the image with the Magic Wand itself. With Color Range, we click on the image with an eyedropper tool. In fact, Color Range gives us three eyedropper tools - one to make the initial selection, one to add to the selection, and one to subtract from the selection - and they're found on the right side of the dialog box.
From left to right, we have the main Eyedropper Tool, used for making our initial color selection (simply click on the image with the Eyedropper Tool to select the color you need), the Add to Sample Tool for adding additional colors to the selection, and the Subtract from Sample Tool to remove colors from the selection. We can switch between the tools by clicking on their icons, but there's actually no need to do that. The main Eyedropper Tool is selected for us by default, and we can temporarily switch to the other tools directly from the keyboard. To switch to the Add to Sample Tool, just hold down your Shift key, then click on the image to add new areas to the selection. To access the Subtract from Sample Tool from the keyboard, hold down your Alt (Win) / Option (Mac) key, then click on the image to remove an area from the selection. In other words, now that you know these three icons are here, you can safely forget all about them:
The Eyedropper Tool, Add to Sample Tool and Subtract from Sample Tool in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
The Eyedropper (left), Add to Sample (middle) and Subtract from Sample (right) tools.

The Selection Preview Window

In the bottom half of the dialog box is the selection preview window where we can see a live preview of which area(s) of the image we've selected after clicking with the eyedroppers. The preview window displays our selection as a grayscale image. If you're familiar with how layer masks work, the preview window works exactly the same way. Areas in the image that are fully selected will appear white in the preview window, while areas that are not selected will appear black. In my case here, nothing is selected at the moment so my preview window is currently filled with solid black. As we'll see, the Color Range command is also capable of partially selecting pixels, which is why it gives us better, more natural results than the Magic Wand. Partially selected areas appear as shades of gray in the preview window. Again, we'll see how this works in a moment:
The selection preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
The selection preview window.

Fuzziness

Once we've clicked on a color in the image, Photoshop goes ahead and selects all of the pixels in the image that are the same color, as well as the pixels that are similar to that color, either lighter or darker. But exactly how much lighter or darker can other pixels be for them to be included in the selection? We need a way to tell Photoshop what the acceptable range is so that all of the pixels that fall within this range will be included in the selection, while the pixels that fall outside this range, either because they're too much lighter or too much darker than the color we clicked on, will not be selected.
Both the Magic Wand and the Color Range command give us ways to tell Photoshop what the acceptable range should be. With the Magic Wand, we use the Tolerance option in the Options Bar. The higher we set the Tolerance value, the wider the acceptable range becomes. For example, if we leave the Tolerance value set to its default of 32 and then click on a color in the image, Photoshop will select all of the pixels that are the same color as the pixel we clicked on, plus all of the pixels that are within 32 brightness levels lighter and 32 brightness levels darker. Increasing the Tolerance value to 100 means we'll select every pixels that's within 100 brightness levels lighter or darker than the color we clicked on, while setting the Tolerance value to 0 means we'll select only the pixels that are the exact same color, nothing more:
The Magic Wand Tolerance option in the Options Bar. Image © 2012 Photoshop Essentials.com
With the Magic Wand selected, the Tolerance option in the Options Bar sets the acceptable color range.
The Color Range dialog box gives us a similar way to set the acceptable range, except here it's not called Tolerance, it's called Fuzziness, and it has a major advantage over the Magic Wand's Tolerance option. We use the Fuzziness value the same way we use Tolerance. The higher we set the Fuzziness value, the more brightness levels we include in the acceptable range. A Fuzziness value of 40, for example, will select all pixels that are the exact same color as the pixel we clicked on, plus all pixels that are within 40 brightness values lighter or darker. Any pixels that are 41 or more brightness levels lighter or darker will be excluded from the selection.
The Tolerance option, though, is very much a "hit or miss" type of thing. If we click on the image with the Magic Wand and realize we didn't get the selection we needed because we used the wrong Tolerance value, all we can do is enter a different value, then click on the image and try again. This "trial and error" approach to selecting pixels can get frustrating very quickly. This is where the Color Range command really shines over the Magic Wand. Unlike the Tolerance value which forces us to guess at the correct value before we click on the image, the Fuzziness value can easily be adjustedafter we've clicked! All we need to do is click once on the image to make the initial selection, and then we can adjust the selection simply by dragging the Fuzziness slider left or right to increase or decrease the range. A live preview of our selection will appear in the preview window as we drag the slider so there's no guesswork needed at all. We'll see an example of how Fuzziness works in a moment:
The Fuzziness option in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
The Fuzziness option is the Color Range version of the Magic Wand's Tolerance option.
Now that we've covered the basics of the Color Range dialog box, let's see it in action. Here's a document I have open in Photoshop made up of a simple dark-to-light blue gradient, with a yellow bar running through the middle:
A dark to light blue gradient divided by a yellow horizontal bar. Image © 2012 Photoshop Essentials.com
A blue gradient divided horizontal by a yellow bar, but you knew that already.
Let's say I want to select part of the blue gradient using the Color Range command. First, I'll go up to the Select menu at the top of the screen and choose Color Range. Then, when the Color Range dialog box appears, I'll make sure my mainEyedropper Tool is selected (which, as we learned, should already be selected by default):
Selecting the Eyedropper Tool in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Making sure the main Eyedropper Tool is active.
With the main Eyedropper Tool active, I'll click somewhere in the middle of the gradient to sample a shade of blue:
Clicking in the middle of the gradient with the Eyedropper Tool. Image © 2012 Photoshop Essentials.com
Clicking in the middle of the gradient with the Eyedropper Tool.
If we look at the selection preview window in the dialog box, we see that I've now selected part of the image based on the shade of blue I clicked on. The white area represents the pixels that are selected, while the black areas are not part of the selection:
The preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
My initial selection in the preview window.
If I click on a different part of the gradient, I'll get a different result. I'll click on a darker shade of blue this time:
Clicking on a darker shade of blue in the gradient. Image © 2012 Photoshop Essentials.com
Clicking with the Eyedropper Tool on a darker shade of blue.
The preview window now shows me that I've selected a different part of the image:
The preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Clicking on a darker shade of blue resulted in a different selection.
And if I click on a lighter shade of blue in the gradient:
Clicking on a lighter shade of blue in the gradient. Image © 2012 Photoshop Essentials.com
Clicking on a lighter shade of blue.
The preview window updates to show me that I've now selected a lighter part of the image:
The preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Lighter shades of blue are now selected. Darker shades are not selected.
Notice that no matter where I clicked on the blue gradient, Photoshop completely ignored the yellow bar in the middle. If I click on the yellow bar:
Clicking on the yellow bar. Image © 2012 Photoshop Essentials.com
Clicking on the yellow bar.
The preview now shows me that the yellow bar is selected, while the blue gradient above and below it is being ignored:
The preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
The yellow bar is now selected. The blue gradient is not.
I'm going to click again in the middle of the blue gradient so we can take a closer look at the Fuzziness option and how it lets us adjust our selection on the fly:
Clicking in the middle of the blue gradient. Image © 2012 Photoshop Essentials.com
Clicking again in the middle of the gradient.
We see in the preview window that I've once again selected an area in the middle:
The preview window in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Back to the original selection.
When I clicked on the middle of the gradient, my Fuzziness value was set to 40, which means Photoshop selected the exact shade of blue I clicked on, plus 40 shades lighter or darker. But what if my Fuzziness value wasn't high enough and I needed to select a greater range of colors? Not a problem! All I need to do is drag the Fuzziness slider towards the right to increase the range. As I drag the slider, the preview window updates to show me my new selection. I'll increase my Fuzziness value to 100, which means I'm now selecting all pixels that are within 100 brightness levels lighter or darker than the shade of blue I initially clicked on. I can see in the preview window that I've now selected a much larger section of the gradient. Likewise, I could have dragged the slider towards the left to lower the Fuzziness value, in which case less of the gradient would be selected:
Increasing the Fuzziness value in the Color Range dialog box. Image © 2012 Photoshop Essentials.com
Increasing the Fuzziness value with the slider increases the selected area in the preview window.
Notice that the display in the preview window isn't limited to just pure white and pure black. Instead, it transitions smoothly and gradually from white to gray to black. That's because the Color Range command is capable of partially selecting pixels. Any pixels that are not the exact color we clicked on but still fall within the acceptable brightness range (set by the Fuzziness value) will be partially selected. These are the gray areas in the preview window. The closer an area is to the color we clicked on, the more selected it will be, represented by lighter shades of gray. Darker shades of gray represent areas that are further away from the color we clicked on and are less selected. This ability to "partially select" pixels can sound a little strange, but it's why the Color Range command gives us much smoother, more natural selections than what we could ever get from the Magic Wand.
Up next, we'll learn how to add and subtract areas from the selection, how to limit where Photoshop looks for similar colors in the image, and we'll see the Color Range command in action in a real word example!

No comments:

Post a Comment