The next two selection techniques are advanced (in that they utilize channels). Remember, channels represent the components of color. The brighter the area in the individual channel, the more coverage there is for that color. By harnessing the black and white details of one (or more) channel you can create a mask. These two techniques won't be appropriate to use every time (they are image dependent), but they are pretty easy to try out and should be part of your skill set.
Using a Channel
In many images, there is often high contrast between the different elements. For example, a person framed by a bright blue sky may clearly stand out, since there are a lot of red values in skin and a lot of blue in the sky. You can make a quick decision whether the channel selection technique will work by looking at the Channels palette. Look for a single channel that is high contrast. It doesn't need to be perfect; you can use the Paintbrush to touch it up.
Let's use the channel selection techniques to select and modify a logo on the side of a building:
Open the image Hotel.tif from the Chapter 5 folder.
Open the Channels palette. Go to the Channels palette submenu (the triangle in the upper-right corner). Choose Palette Options and set the thumbnail to the largest size.
In the Channels palette, click on the word Red to view just the red channel. Examine the channel for contrast detail. Repeat for the green and blue channels. Look for the channel with the cleanest separation of the motel's name. The blue channel should appear the cleanest.
Right-click (Ctrl-click with a single-button mouse) on the blue channel and choose Duplicate Channel. Name it Selection and click OK to create a new (alpha) channel.
The new channel should be automatically selected.
Press Cmd+L (Ctrl+L) to invoke a Levels adjustment. This will allow you to adjust contrast on the mask. Make sure the Preview box is checked.
Move the Black Input Levels slider to the right to increase contrast in the black areas.
Move the White Input Levels slider to the left to increase contrast in the white areas.
Move the middle (gray) slider to the right to touch up the spotty areas.
Click OK to apply the adjustment to the channel.
To soften the edges of the channel, choose Filter > Blur > Gaussian Blur. Apply the filter with a value of 2 or 3 pixels to soften the edge.
To load the selection Cmd-click (Ctrl-click) the Selection channel. This will create an active selection.
Since we want to work with the image data (in this case the sign) we need to select and enable the RGB channels. Click the visibility icon next to the RGB channels to enable them. Turn the Selection channel off by clicking the visibility icon. You should still have an active selection.
Switch back to the Layers palette and click the Background layer to activate it.
Press Cmd+C (Ctrl+C) to copy the text to your clipboard.
Since we are done with the current selection, choose Select > Deselect or press Cmd + D (Ctrl+D) to disable the active selection.
Choose Layer > New Fill Layer > Solid Color then click OK.
From the Color Picker, choose a highly saturated color and click OK.
Choose Edit > Paste or press Cmd+V (Ctrl+V) to paste your clipboard contents. The text from your clipboard should be added above the solid color layer.
If you then want to clean up the text, you can reload the selection by choosing Select > Reselect.
Choose Edit > Fill and select White at 100%. Click OK to apply the fill.
You can use the Calculations command to create a new selection based on the details in an image's channels. This technique is a hit-or-miss, as it won't work with every image. But when it succeeds, it's a big success. The Calculations command works well when there is high contrast between the subject and the background. You'll want to look at each channel independently until you find ones with highest contrast. Depending on the source photo, you will generate anything from a perfect selection to a great start.
Let's put the Calculations command into action to create an active selection and a saved alpha channel:
Open the file Independence Hall.tif from the Chapter 5 folder.
Bring up the Channels palette (Windows > Channels) and look for the highest contrasting channels. Because you want to remove the background, look for the contrast between foreground and background. The blue channel should stand out the most.
The name Calculations can be scary, as math is not the most popular subject for many people. But don't worry; the computer will do all of the calculations for you as it combines two channels to create a new selection.
Choose Image > Calculations and make sure the Preview box is checked. We'll now combine two of the color channels to create a new alpha channel. An alpha channel is simply a saved selection. You can Cmd-click (Ctrl-click) it to turn it into an active selection.
In the Source 1 area, set the Channel to Blue.
In the Source 2 area, we'll experiment to find the right combination. The red channel is a good place to start, as it looks very different than the blue channel. It's also a good idea to experiment by clicking the Invert button to reverse the channel. Calculations is all about trial and error, but since it works so well, taking a little time to experiment is worth it.
Combine the red and blue channels by using Blending. From the drop-down list, try different Blending modes. Blending modes control how two different images or channels blend together placed on their color and luminance values (for more on blending modes see Chapter 9, "Using Blending Modes." Different source images will need different modes. Experiment by clicking through each mode on the list. You may also want to try unchecking the Invert box when working with other images. In the Independence Hall image, the blue and red (inverted) channels combine most effectively using the Vivid Light Blending mode. This will create a new channel that has clean separation between the building and sky.
Click OK to create a new channel. The channel, called Alpha 1, should be selected in the Channels palette. Photoshop turned the RGB channels off for now.
Choose the Brush tool and set the foreground color to white.
Paint over the trees so the sky becomes pure white.
Run a Levels adjustment on the channel to adjust the contrast between black and white. Choose Image > Adjust > Levels or press Cmd+L (Ctrl+L). Move the Black Input slider to the right to darken the gray areas to black. Move the White Input slider to the left to brighten the whites in the image. Move the Gray (gamma) slider to the right to close up gray areas.
Click the OK button to apply the Levels adjustment.
Zoom in to 100% magnification to look for gaps in the alpha channel. You should see a few in the tower. With your Paintbrush set to black, paint out the spotting.
Cmd-click (Ctrl-click) on the alpha channel thumbnail to load the selection. You will need to choose Select > Inverse to choose Independence Hall.
Click the visibility icon next to the RGB composite channel.
Look closely at the selection; it should be pretty impressive. You could now copy the image and add it to a different composite image, or run a filter or image processing command on the building. With a little bit of experimentation, a perfect alpha channel can be generated and turned into a layer mask (as we'll try in Chapter 7, "Layer Masking"). Calculations isn't a solution all the time, but it's worth a try when you have high-contrast channels.
Advice on Selections
There is no single technique that is ideal for making the perfect selections. Every image is unique and will require you to analyze it. Knowing multiple techniques is very important, as it expands your options. Get comfortable with all of the techniques in this chapter and be sure to practice. Practice really does make perfect.