Chapter 10: All about Layers 327 FIGURE 10.26 Making the Water Paper filter the base of the filters added is a better result than placing it on top. Layer Masks Think of a mask as a stencil. If you place a stencil over an area that you are painting, it protects the areas that are covered and creates a painted design in the bargain. Masks in Photoshop work the same way, but you can do so much more with an image than just paint over it. Every enhancement or filter available in Photoshop can be applied to just a portion of your image while leaving the rest of your image untouched using masks. Wait a minute. Doesn’t this sound just like what a selection does? It’s true, a selection is actually a type of mask—a selection mask, and I’ve already shown you how to work with Quick Masks and the color overlay masks to refine your selections. Now we’re going to move one step beyond selections to Layer Masks, which are more permanent extensions of selections. A layer mask is what most people think of when thinking about masks in Photoshop. Figure 10.27 shows a layer mask. Just like a stencil, the black parts cover areas of the image that will be unaf- fected by any changes made to this layer. It also makes those areas transparent so that any layers underneath will be visible. The white areas of the mask are areas that will be affected by any changes made to the layer. These areas behave just as if they were all the image pixels contained in this layer. For instance, you can see in Figure 10.22 that the Drop Shadow Layer Style that was added created a drop shadow only of the unmasked areas of the image. 16_584743-ch10.indd 32716_584743-ch10.indd 327 5/3/10 10:25 AM5/3/10 10:25 AM Part III: Selections, Layers, and Channels 328 FIGURE 10.27 Placing a mask in a layer protects portions of it from edits. One of the best aspects of using digital layers over stencils is that it is incredibly easy to create semi-permeable areas of a mask with grayscale tones. The lighter a grayscale area is, the more any changes you make to your image affect those areas. Creating masks You can create layer masks in several ways. All but one of these ways usually begins by creating a selection. After you’ve created a selection, turning it into a mask is fairly simple. After you’ve cre- ated a mask, you can move it between layers to facilitate image composites and special effects. Using the Add Mask icon The fastest way to create a mask is to click one of the Add Mask icons in the Layers panel or in the Masks panel, as shown in Figure 10.28. If you have an area in your image selected, a mask is cre- ated from that selection. You also can create a mask from a path. If no selection or path is active, the mask is blank. Two different types of masks can be created using these icons: a pixel mask and a vector mask. The type of mask created depends on whether you create the mask from a selection or a path. Pixel masks Pixel masks are rasterized masks and behave just like raster images, as discussed in Chapter 3. They are built from pixels and lose quality if they are resized. If you create a mask from a selection, it is a pixel mask, whether you use the Add Layer Mask icon in the Layers panel or the Add Pixel Mask in the Masks panel. If you click the Add Vector Mask icon in the Masks panel, the selection is not used to create a vector mask on the selected layer. 16_584743-ch10.indd 32816_584743-ch10.indd 328 5/3/10 10:25 AM5/3/10 10:25 AM Chapter 10: All about Layers 329 FIGURE 10.28 Use the Add Mask icons to quickly add a mask to a selected layer. Vector masks Vector masks are built mathematically and are recomputed as they are resized so they don’t lose quality. You can create a vector mask from a path either by creating a path or turning a selection into a path. These masks can be edited using only the vector tools, such as the pen tools or the shape tools. Just as a selection can’t be used to create a vector mask, a path can’t be used to create a pixel mask. Using the Refine Edge dialog box I showed you the ins and outs of the Refine Edge dialog box in Chapter 9. New in Photoshop CS5, you can use this dialog box to export your selection as a mask over your current layer, a mask over a new layer, or a mask over a new layer in a new document. Regardless of which option you choose, your selection is changed into a mask with properties identical to the mask shown in Figure 10.36. Using the Feather option in the Refine Edge dialog box adds an increasingly more transparent edge to your mask, which is indicated by levels of grayscale. Type masks You can create type masks over your image by using the type mask tools found in the Toolbox, as shown in Figure 10.29. These tools work like the type tools, but rather than creating solid text on a separate layer, the type mask tools create a selection that surrounds the type on the selected 16_584743-ch10.indd 32916_584743-ch10.indd 329 5/3/10 10:25 AM5/3/10 10:25 AM Part III: Selections, Layers, and Channels 330 layer. After you’ve created a selection using type, you can create a mask from that selection using the Refine Edge dialog box or the Add Mask icons. FIGURE 10.29 The type mask tools can create masks in your image using type. Clipping masks Clipping masks are not created using a selection, nor do they look like a traditional mask in your Layers panel. A clipping mask is created by taking the shape of one layer and cutting that shape out of the layer above it. Create a clipping mask by following these steps: On the Web Site Try it yourself by downloading Figure 10-30a and Figure 10-30b from the Web site. n 1. Open an image you want to clip. This can be any image you want. I’ve chosen the Halloween photo pictured first in Figure 10.30. 2. Double-click the background layer to turn it into a regular layer. You can name the layer if you would like to. 16_584743-ch10.indd 33016_584743-ch10.indd 330 5/3/10 10:25 AM5/3/10 10:25 AM Chapter 10: All about Layers 331 3. Create a layer with a cut-out to clip from. This can be a shape layer, a text layer, or a selection from another image. I chose the lat- ter option and used the selection of a spider I copied and pasted into its own layer, as shown in the second image in Figure 10.30 FIGURE 10.30 I combine these two images with a clipping mask. 4. Place the layer with the cut-out underneath the image layer. If you’ve created a new layer in your document, it was automatically placed above your image layer. Click and drag it underneath your image layer. 5. Select the image layer. This is the layer that you want to be visible in the end. My selected layer is the one with the jack-o-lanterns. 6. Right-click the image layer, and select Create Clipping mask from the pop-up menu. This uses the bottom layer as a template to cut the top layer, as shown in Figure 10.31. The bottom layer becomes a silhouette for the top layer. On the Web Site Look at my final product by downloading Figure 10-31 from the Web site and looking at the layers. n Creating a clipping mask changed the way the layers look in the Layers panel, but not by placing a mask thumbnail in the selected layer. Instead, the layer containing the jack-o-lantern image has been turned into a Smart Object, and an arrow has been placed pointing down to indicate that this layer is being affected by the layer underneath. You can release the clipping mask by right-clicking the top layer again and choosing Release Clipping Mask from the pop-up menu. 16_584743-ch10.indd 33116_584743-ch10.indd 331 5/3/10 10:25 AM5/3/10 10:25 AM Part III: Selections, Layers, and Channels 332 FIGURE 10.31 The clipping mask used the spider as a template to cut out the jack-o-lantern image for spooky effect. Editing masks After a mask thumbnail has been placed in your Layers panel, you can edit it. You can edit the mask using the image, the channels, or the Masks panel. Edit a mask by painting on the image To edit the mask using the image, you must have the mask selected in the layer. Make sure the mask thumbnail has a white highlight around it, rather than the image thumbnail. This is some- times hard to see, so click back and forth a couple of times to see the difference. After you have selected the mask, you can use the Brush and Eraser tools to add to or subtract from the masked area. Using the Brush adds to the mask and using the Eraser subtracts from it. Use these tools directly on your image. The only difference you see is a change in the masks effects. Depending on what those changes are, this might not be the ideal way to edit your mask, because it is hard to be precise if the effects of the mask aren’t obvious. For instance, the mask in Figure 10.32 is placed over an exposure adjustment, and changes made to this mask simply lighten or darken the image a little, a hard change to see. Note Reducing the opacity on either the Brush or the Eraser tool paints levels of grayscale, creating a semi-permeable area of your mask. n Edit masks using the Channels panel A better option for editing this mask is to use the Channels panel. With the mask selected in the Layers panel, open the Channels panel, as shown in Figure 10.33. The channels panel contains the color channels found in your image, but it also contains any masks placed in your image. When you open the Channels panel, the mask channels are not visible. If you turn the visibility icon on, a rubylith mask appears in your image, reminiscent of the Quick Mask. Now as you make changes to the mask, you can see them clearly. 16_584743-ch10.indd 33216_584743-ch10.indd 332 5/3/10 10:25 AM5/3/10 10:25 AM Chapter 10: All about Layers 333 FIGURE 10.32 The white outline showing that the mask is selected means that I am making changes to the mask with the brush, rather than the image. If you would like to make changes to the mask all by itself, without a view of the image, you can deselect the visibility icon in the full color channel (RGB, in this example) and only the mask is vis- ible in your document window, as shown in Figure 10.33. FIGURE 10.33 You can edit the mask by itself by turning off the visibility of the color channels in the Channels panel. 16_584743-ch10.indd 33316_584743-ch10.indd 333 5/3/10 10:25 AM5/3/10 10:25 AM Part III: Selections, Layers, and Channels 334 Tip Layers and Channels are usually in the same tab group. If you are working with both simultaneously, however, it might be easier to undock one or the other and drag it out so both can be seen at the same time. n Editing masks using the Masks panel The Masks panel is the most comprehensive way to edit masks, not only giving you the option to add to or subtract from them but also allowing you to refine the edges, choose a color range, or invert it. You also can change your mask into a selection. Figure 10.34 shows the Masks panel. These options are available: FIGURE 10.34 The Masks panel Add Pixel Mask Add Vector Mask Load Selection from Mask Apply Mask Disable/Enable Mask l Mask thumbnail: The mask thumbnail shows you the currently selected mask as well as whether the mask is a pixel mask or a vector mask. l Add Pixel Mask: This button adds a pixel mask to the selected layer. If that layer contains an active selection, it is converted to the mask. l Add Vector Mask: This button adds a vector mask to the selected layer. If that layer con- tains an active path, the path is converted to the mask. 16_584743-ch10.indd 33416_584743-ch10.indd 334 5/3/10 10:25 AM5/3/10 10:25 AM Chapter 10: All about Layers 335 l Density: This slider adjusts the density or translucency of the mask. l Feather: This option adjusts the gradual translucency of the edges of the mask, creating a feathering effect. l Refine: l Mask Edge: This opens the Refine Edge dialog box (covered in Chapter 9) and allows you to make these changes to your mask. l Color Range: This allows you to apply your mask to a color range, similar to the Color Range dialog box discussed in Chapter 9. l Invert: This inverts the mask, selecting areas that were not previously selected and dese- lecting areas that were. Areas that are semitransparent also are inverted. l Load Selection from Mask: This option does not disable the mask, but allows you to make changes to it as if it were a selection. The marching ants appear on your image, and you can use selection tools to add to or subtract from the mask. You also can use the Quick Mask to paint in changes to the mask. l Apply Mask: Clicking this option combines a selected mask to the image, turning all masked areas into transparent pixels and deleting the mask. l Enable/Disable Mask: This “eye”con allows you to see the image as if no mask were applied. When the eye has a red line through it, the mask effects are not visible in the image. l The Masks panel menu: The Masks panel menu has options that allow you to add or subtract selections to or from your mask. You also can see the mask properties that allow you to change the color of the overlay and give names to your masks. Unlinking and moving masks To unlink a mask from its layer, simply click the link icon between the layer thumbnail and the mask thumbnail in the layer. When the mask is unlinked, it is no longer transformed with the image when it is resized or moved. You also can move masks from one layer to a different layer. You would probably do this if you wanted to create a selection in one layer, but use the mask in an entirely different layer. Let me show you what I mean. The first image in Figure 10.35 is a photo of some boys gathered around a table at the zoo. The second image is a cold baby giraffe that just wants a bit of hot chocolate. In order to create the photo composite you see in the last image in Figure 10.35, I had to create a mask on the layer con- taining the image of the boys and move it to the layer containing the image of the giraffe. On the Web Site Give this effect a try, or see my final results, by downloading Figure 10-35a, 10-35b, and 10-35c from the Web site. n 16_584743-ch10.indd 33516_584743-ch10.indd 335 5/3/10 10:25 AM5/3/10 10:25 AM . when thinking about masks in Photoshop. Figure 10.27 shows a layer mask. Just like a stencil, the black parts cover areas of the image that will be unaf- fected by any changes made to this layer mask is created by taking the shape of one layer and cutting that shape out of the layer above it. Create a clipping mask by following these steps: On the Web Site Try it yourself by downloading. edit the mask by itself by turning off the visibility of the color channels in the Channels panel. 16_584743-ch10.indd 33316_584743-ch10.indd 333 5/3/10 10:25 AM5/3/10 10:25 AM Part III: Selections,