Painting and Editing Inside Selections
Before we immerse ourselves in masking techniques, let's start with a warm-up topic: selection masking. When you were in grade school, you may have had a teacher who nagged you to color within the lines. (I didn't. My teachers were more concerned about preventing me from writing on the walls and coloring on the other kids, or so I'm told.) If so, your teacher would have loved this incredibly straightforward feature. In Photoshop, all selection outlines act as masks — hence the term selection masking. (And you thought this chapter was going to be hard.) Regardless of which tool you use to create the selection — marquee, lasso, magic wand, or pen — Photoshop permits you to paint or edit only the selected area. The paint can't enter the deselected (or protected) portions of the image, so you can't help but paint inside the lines. If you dread painting inside an image because you're afraid you'll screw it up, selection masking is the answer.Figures 9-3 through 9-6 show a sculpted head subject to some pretty free-and-easy use of the paint and edit tools. (In case this whole book-writing thing falls through, I plan to look for work as a hairdresser.) The following steps describe how I created these images using a selection mask.
STEPS: Painting and Editing inside a Selection Mask
I selected the sculpted head. You can see the selection outline in the right example of Chapter 8.

Figure 9-3: Starting with the image shown at left, I drew a selection outline around the sculpted head, inversed the selection, and deleted the background, as you can see in the right-hand image.
I reversed the selection with the Inverse command. I wanted to edit the area surrounding the head, so I chose Select Inverse (that's Ctrl+Shift+I under Windows or z -Shift-I on the Mac) to reverse which areas were selected and which were not.
I pressed Ctrl+Backspace (z -Delete on the Mac) to fill the selected area with the background color. In this case, the background color was gray — as shown in the right half of Figure 9-3.
I painted inside the selection mask. But before I began, I chose View Extras (Ctrl+H or z -H). This toggled off those infernal marching ants, which enabled me to paint without being distracted. (In fact, this is one of the most essential reasons for toggling the Extras command.)
I selected the brush tool and expressed myself. I chose a 150-pixel brush in the Brushes palette. With the foreground color set to black, I dragged around the perimeter of the head to set it apart from its gray background, and then roughed in an outline around the black using white, as shown in Figure 9-4. I also painted inside the eye sockets of the head. Even though the brush was wider than the eye sockets, the head remained unscathed.

Figure 9-4: I painted inside the selection mask with a 150-pixel brush.
I put the smudge tool to work. I set the tool's Strength value to 80 percent by pressing the 8 key. I dragged from inside the head outward 20 or so times to create a series of curlicues. As shown in Figure 9-5, the smudge tool can smear colors from inside the protected area, but it does not apply these colors until you go inside the selection. This is an important point to remember because it demonstrates that although the protected area is safe from all changes, the selected area may be influenced by colors from protected pixels.

Figure 9-5: Dragging with the smudge tool smeared colors from pixels outside the selection mask without changing the appearance of those pixels.
I added some embellishments. Okay, as you can see in Figure 9-6, I got a little carried away here. The selection mask came in handy when I used the burn tool to darken the background around the base of the head, and I inversed the mask again so I could burn some dark areas into the face. But in my zeal to create fabulous hair, I went a little beyond the bounds of this exercise: I created a separate layer and used the smudge tool set to Use All Layers to help blend the wild background in with the head.

Figure 9-6: Pretty wild effect, huh? This actually reminds me a little of my Godspell Original Cast Album cover.