Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Photoshop

  • Print
  • + Share This
This chapter is from the book

A Deeper Look Into Layer Masks

LET’S TAKE A DEEPER LOOK INTO LAYER MASKS AND SOME OF THE COOL THINGS YOU CAN DO WITH THEM

Layer masks aren’t just for collaging and blending photos, they’re actually a very powerful selection and design tool. Let’s take a look at a real project and see how layer masks can be used to make something appear in a photo that it didn’t originally appear in. Plus, you’ll see the effect of stacking multiple layers with layer masks on top of each other for an even better result.

Step 1: Open the Images for the Masking Project

Open the photos that you want to bring together with layer masks. In this example, I’ve got a photo of an LCD screen and a photo of a woman skiing. We’ll use layer masks to make it appear as if she is breaking out of the LCD screen, and then put it onto the home-page of a website.

Step 2: Use Select>Color Range to Select the Skier from the Background

Start with the photo of the skier first. Click the Select menu and choose Color Range. Since we want to make it appear as if the skier is breaking out of something, we need to get rid of the sky. In the Color Range dialog, click on the photo near the top part of the sky. That tells Color Range to select those colors. With the preview set to Selection, you’ll see the selected portion turn white. Press-and-hold the Shift key and click in other areas of the blue sky to select them, since the color gradates toward the bottom (Shift-click and select about five other points). Then, set the Fuzziness slider to 160 and click OK.

Step 3: Inverse the Selection and Copy it to its Own Layer

Right now, you should have the sky selected. What we really want is the skier selected, so click the Select menu and choose Inverse to reverse the selection (or press Command-Shift-I [PC: Ctrl-Shift-I]). Then, put this selection on its own layer by pressing Command-J (PC: Ctrl-J).

Step 4: Select Both Layers and Move them into the LCD Photo. Link the Two Layers

Select both layers in the Layers panel by Command-clicking (PC: Ctrl-clicking) on them. Then click-and-drag them over the LCD screen in that photo. Now you’ll have three layers in the Layers panel, and the two skier layers should still be selected. Go ahead and click on the Link Layers icon on the far left at the bottom of the Layers panel to link these layers. Now, anytime you move one layer, the other will always follow. If they don’t cover the screen completely, press Command-T (PC: Ctrl-T) to go into Free Transform, click the Link icon in the Options Bar, increase the Width percentage until they do, then press Return (PC: Enter) to lock it in.

Step 5: Hide the Two Skier Layers. Use the Polygonal Lasso Tool to Select the Screen

Click on the Eye icons in front of the two skier layers to hide them, so you can see the LCD again. Select the Polygonal Lasso tool from the Toolbox, or press Shift-L until you have it, and make a rectangular selection of the LCD screen.

Step 6: Unhide the Skier Layers and Add a Layer Mask to the Bottom Copy

Click where those Eye icons used to be to unhide the two skier layers so you can see them again. Don’t deselect yet, though. Click on the bottom skier layer (the entire photo), and click on the Add Layer Mask icon at the bottom of the Layers panel to add a layer mask to it. Photoshop automatically hides all parts of the layer that extend beyond the LCD screen. However, we still have the layer with only the skier on top of it, so we’ll still see her.

Step 7: Copy the Layer Mask by Option-Dragging it from One Layer to the Other

Now we’ll want to apply that same layer mask to the layer above it. The last thing we want to do, though, is make the selection all over again. Instead, we’ll just copy the layer mask. The easiest way to copy a layer mask is to press-and-hold the Option (PC: Alt) key and click-and-drag the layer mask from one layer to another. This duplicates the mask onto the other skier layer. Notice that it hides any areas that extend beyond the LCD screen, though, including part of her arms, head, and skis. No problem—we’ll take care of that in a minute.

Step 8: What Happens if You Need to Reposition the Layers?

Before we move on, I want to show you some tips you’ll use often. See, back in Step 4 we moved the two layers of the skier on top of the LCD screen and just left them there. But what happens if you decide later you want to move them and you’ve already added masks (as in this case)? I’m glad you asked. First, we just added a mask over the skier so we can’t see most of her anymore. But I want to reposition her skis so they break out over the monitor, which means I’ll need to see the layer without the mask. Easy stuff. Just Shift-click on the layer mask thumbnail in the Layers panel to temporarily disable the mask.

Step 9: Unlink the Layer Mask from the Layer so You can Move it

Before you jump ahead and move the layer, we need to do one more thing. There’s a little link icon between the layer thumbnail and the layer mask thumbnail. This means that if we move the layer, the layer mask will follow because they’re linked. However, that’s not what we want here. We just want to move the layer and leave the mask where it is, since the LCD screen position won’t change. So, click the link icon to turn it off. Remember, though, we have two skier layers linked together here, so you’ll need to turn the other layer mask link off, too. Now select the Move tool (V) and move both layers. The masks will stay put. Relink the layer masks to the layers, and click on the top layer’s mask to turn it back on.

Step 10: Select the Brush Tool and Paint the Hidden Portions of the Skier Back in

Okay, take a breath for a minute. Look at the Layers panel—specifically the top layer. It’s the one of the skier with the sky removed. We added a layer mask to it in Step 7 that hid any areas that extend beyond the LCD screen. Right now, the only part of this layer we see is where the mask is white, right? We need to see the parts of the skier that extend beyond the screen to get that breaking out effect. Select the Brush tool (B), make sure you’re Foreground color is white, and paint to reveal only the skier as she breaks out of the screen. Use a fairly large brush (I used a 100-pixel brush here) and don’t worry if you reveal any extra areas. We’ll get rid of them next.

Step 11: Zoom in and Use Smaller Brush Sizes to Make it Look More Realistic

If yours looks like mine at this point, then you probably revealed too many extraneous areas around the skier in the last step. That’s totally fine and actually it’s better that way because now you can use the Zoom tool (Z) to zoom in, press X to switch your Foreground color to black, and paint with a smaller brush to hide all of those little areas that just don’t fit. In this example, I hid any snow areas that appeared over the monitor edges so only the skier and her skis show up outside the monitor, not any of the little pieces of snow. This part takes a little time, though, so be patient and make it look good.

Step 12: Use the Dodge Tool to Lighten the Snowflakes

If your image still looks like mine, you’ve also probably got some little blue outlines around some of the snowflakes. This happened when we selected the skier from the sky and is pretty normal. You can always choose to hide them with the layer mask. If you want to leave them in, however, select the Dodge tool from the Toolbox (or just press O). Click on the layer’s thumbnail instead of the mask, set the Range to Shadows in the Options Bar, and set your Foreground color to black. Then paint over the edges of the snowflakes to lighten the darker colors. This should help them blend in.

Step 13: Let’s Bring in a Photo for the Background

We’re almost done. One thing we’ll want to do is bring in a photo for the background of the webpage. So, open another photo. Select the Rectangular Marquee tool (M) and make a large rectangular selection. Then click the Select menu and choose Modify>Smooth. Enter 20 pixels for the Sample Radius, and click OK.

Step 14: Copy-and-Paste the Background Photo into Our Webpage Image. Add a White Stroke

Copy-and-paste the selection into our main webpage image by pressing Command-C (PC: Ctrl-C), switching to the webpage image, and pressing Command-V (PC: Ctrl-V). Choose Edit>Free Transform to resize it and position it toward the top middle of the image. Then Command-click (PC: Ctrl-click) on the layer thumbnail to put a selection around the photo. Click the Edit menu and choose Stroke. Enter 6 pixels for the Width and set the Color to white. Click OK, and now you’ll have a white stroke around the selection. Press Command-D (PC: Ctrl-D) to Deselect.

Step 15: Make a Selection Around the Entire LCD Monitor

You’ll notice that the large photo we just copied in covers the LCD and the skier. We’ve got to change that. So, guess what that means. Yep, another mask. This time, instead of selecting just the inside of the LCD screen, we’ve got to select the whole LCD monitor itself. Click on the Eye icon next to the snowy mountain photo layer to hide it. Grab the Polygonal Lasso tool again and make a selection around most of the monitor. It’s okay if you don’t select the bottom part, but make sure you get the whole screen and some of the stand. Once you’ve made the selection, unhide the layer.

Step 16: Add a Layer Mask to the Large Photo Layer and Invert it

Since we have a selection active, go ahead and add a layer mask to the mountain photo layer. This masks the photo so it fits into the selection, which is actually the opposite of what we want. We want to see the photo everywhere but over the LCD. Well, that leads me to another cool tip—inverting. Click on the layer mask and choose Image>Adjustments>Invert. This inverts, or reverses, the color of everything on a layer. Black becomes white and white becomes black.

Step 17: Move the Mountain Layer Below the Skier. Bring in the Final Elements

Now, click on the mountain photo layer and drag it below the skier layers so she doesn’t cover the photo. Now add the final elements that make up the webpage. Here, they’re pieces in another file, but you could just as easily create the text right here in the document itself (see Chapter 5 for more on creating text).

  • + Share This
  • 🔖 Save To Your Account