Techniques

Full Control in Photoshop: Layers & Masks

by Tim Grey | February 1, 2008

© Tim GreyPhotography is in large part about exercising control (or maybe that’s just the excuse I use because I happen to be such a control freak). Since the dawn of photography there has been an effort to control the light, the subject, the print, and all other factors that influence the final photographic image. I love being able to exercise control over the process of producing a photographic image, so I’m particularly happy to have a great many digital tools available for this purpose, not the least of which is Photoshop. Through the use of layers and masks, Photoshop provides an incredible degree of flexibility and control, enabling you to truly achieve your photographic vision.

It Starts with Layers

Layers are the foundation of a workflow in Photoshop that provides the greatest flexibility, control, and image quality. By separating each individual adjustment onto an individual layer, you’re both preserving the original pixel values and creating individual components for each adjustment.

Layers - Levels... palette

Preserving the original pixel values is important because it gives you something to fall back on in the event you change your mind about an adjustment layer. It is worth noting that all adjustments that directly change pixel values are destructive on some level in that they cause a change to the image data. Using layers prevents applying multiple adjustments to arrive at a single result, helping to maintain maximum image quality. For example, if you make several adjustments increasing contrast in the image you’ll lose more detail than if you made a single contrast adjustment to the final settings. An adjustment layer counts as that single adjustment, no matter how many times you fine tune the settings, because the adjustment is stored as a set of instructions rather than having changes directly apply to the pixel values.

Having individual components for each adjustment is important because it allows you to view before and after versions of the image based on each individual change, and because it enables you to return to any individual adjustment to refine it. This is a big part of the control you’re able to exercise over your images.

Layer selected

Adjustment layers are derived from the Create New Adjustment Layer button (the icon has a half-black and half-white circle) at the bottom of the Layers palette. When you click this button you’ll see a list of available adjustment layers. Simply choose the type of adjustment you want to apply to your image from the list and the adjustment layer will be added to the Layers palette and the dialog box for that adjustment will be opened. Apply the adjustment, click OK, and you’re all set. When you want to refine the adjustment, simply double-click the thumbnail for the adjustment layer on the Layers palette, make your refinements, and click OK. You can also view a before and after comparison by hiding the adjustment layer. Click the eye icon to the left of the adjustment layer thumbnail to hide the layer, and click in the box where the eye icon appeared to enable the adjustment again.

Masking 101

Now, adjustment layers are great, and I recommend using them for all adjustments you would otherwise apply directly to pixel values in your images. They’re simply the best way to apply adjustments within Photoshop. But as great as they are, their use alone only gets you so far. What you really want to be able to do is apply adjustments in a targeted way, so you can darken only the sky, for example. That involves a concept called layer masking in conjunction with your adjustment layers.

Before we can get started applying targeted adjustments in Photoshop, it is important to understand the concept of layer masking, which is what makes the targeted adjustments possible. I have found it helpful to teach the concept of masking by starting with the notion of creating a composite image from two source images, because it provides a more tangible experience of the process than applying a targeted adjustment. It is then relatively easy to apply the concepts to the more challenging topic of targeted adjustments.

Layer mask

To get started with basic layer masking, open two images in Photoshop. One of them will be the “background” and the other will be the “top” image that contains the object you want to put on that new background. Use the Move tool and drag the top image to the background image. Make sure to drag the mouse all the way into the background image document before releasing the mouse button so the image will be copied as a new layer into the background image. You can then close the top image layer since it has been copied into the background image.

The next step is to add a layer mask to the top image layer so you can block all areas of it except the object you want visible. Make sure the top layer is active on the Layers palette (click on the thumbnail for that layer if it isn’t) and click the Add Layer Mask button (it has an icon of a circle inside a square) at the bottom of the Layers palette. You’ll see a new all-white thumbnail added to the right of the image layer. This is the layer mask.

The key concept to remember with layer masks is that “black blocks and white reveals.” The all-white layer mask will allow all pixels in the top image layer to be visible. You want to selectively block pixels, so select the Brush tool and press “D” to set the colors to their default values of black and white. Press “X” if needed to make black the foreground color, and move your mouse over the top image. Adjust the brush size as needed using the left and right square bracket keys (“[” and “]”). When you’re ready to start blocking pixels, paint with black in the areas you want to hide. The result will be like erasing pixels, but with an important difference. If you make a mistake and need to reveal pixels that have been hidden, press “X” to set white as the foreground color and paint over that area. The pixels will magically reappear.

Layered photos

Practice this technique to create a composite image and help get the concepts firmly into your mind. This will make it much easier to grasp the next level, which is to apply layer masks to adjustment layers. You can paint with a slightly soft-edged brush to allow the object to blend into the new background, or simply select Filter > Blur > Gaussian Blur from the menu and apply a very slight blur to the layer mask to produce the same blending.

Edited photo

Taking Control

You’ve now learned about adjustment layers and layer masks, so it is time to put the two concepts together to allow you to exercise greater control over your images. To get started, simply use an adjustment layer to apply a change to your image. As you’ve already seen, the adjustment will affect all pixels in the image. What you might also notice at this point is that all adjustment layers start off with an all-white layer mask – you don’t need to add one the way you do with image layers. Because the layer mask associated with the adjustment layer is entirely white, it means the adjustment will apply (by default) to all pixels in the image.

To block the adjustment from specific areas of the image, simply paint with black just as you did for masking two images together in the composite from the prior section. It can be helpful to start with an adjustment that is a bit stronger than you intend, so you can better see where the effect is applying to the image versus being blocked. You can then go back and refine the adjustment once you’re happy with the masking job you’ve done.

Paint the mask

Remember that “black blocks and white reveals” and you can paint with black or white using a soft-edged brush to selectively apply the adjustment.

Selective Adjustments

It is great to be able to paint the adjustments onto (or off of) your images by painting on the layer mask associated with the adjustment layer, but sometimes it is faster and easier to start with a selection of the area you want to adjust and then mask the adjustment layer based on that selection.

Zoom view

Start by creating a selection of the area you want to adjust in the image, using any of the selection tools available to you in Photoshop. With that selection active, you can create a new adjustment layer, and the layer mask associated with that adjustment will automatically reflect your selection. In other words, as you start adjusting the settings in the adjustment layer you’ll see that only the area you had selected is being affected. My recommendation is to create a selection without feathering, and then apply a slight Gaussian Blur from Filter > Blur > Gaussian Blur so the adjustment will blend into the non-adjusted areas and not look obvious to the viewer.

Curves

Layer group

Extreme Control Freak

When you anticipate the need to make multiple adjustments to the same area, you’ll want to first create a layer group to contain all of the adjustments. This will allow you to use a single layer mask for all of the adjustments. The most significant benefit of this is that you’ll be able to change a single layer mask if you discover there had been a problem, rather than needing to change the same mask for multiple layers if you had created them individually.

Start by creating a new layer group by clicking the Create a New Group button (it has an icon of a folder) at the bottom of the Layers palette. You can then create a selection of the area you want to adjust and add a layer mask to that layer group, or simply add an empty layer mask to the layer group on which you can paint to define where the adjustments should apply.

Next, with the layer group selected on the Layers palette, add as many adjustment layers as you’d like. They’ll go into the layer group by default (since it is selected). Then refine the layer mask associated with the layer group to constrain the adjustment layers within that layer group and they will only affect the area defined by that layer mask. The result is an ability to have a single layer mask that constrains the behavior of a whole set of adjustment layers.

Grouped layers

It gets better! If you’d like to refine the layer mask by using two layer masks for the same group, you can do that. A great example is when you want to apply adjustments to only the sky, but you want to apply them in a gradient fashion. Simply add another layer group with a layer mask, and drag the first layer group into the second. For one of them create a layer mask that will constrain the adjustments to the sky, and for the other add a gradient with the Gradient tool that defines a white-to-black transition for the areas you want to affect to those you don’t.

The result is an extreme degree of control over your images, thanks to adjustment layers, layer groups, and layer masks.

About the Author

Tim Grey is an educator in digital photography and imaging, offering clear guidance on complex subjects through his writing and speaking.

Tim has written more than a dozen books on digital imaging for photographers, has published dozens of video training courses, has had hundreds of articles published in magazines such as Digital Photo Pro and Outdoor Photographer, among others. For more than a dozen years he has been publishing the daily Ask Tim Grey eNewsletter, answering questions from photographers, and produces the related Ask Tim Grey Podcast. He also publishes the monthly Pixology electronic magazine, and publishes video training courses through GreyLearning.com. Tim teaches through workshops, seminars, and appearances at major events around the country and around the world.

Tim can be reached via email at tim@timgrey.com.

Post a Comment

Logged in as Anonymous