Adjustment Layer Plus Layer Mask Equals Ultimate Flexibility
By now you should know that adjustment layers are much more flexible than traditional methods of adjusting images. What we did last week affected the entire image, but sometimes you really only want to tweak a particular area. This week we'll take a look at how to limit the effect adjustment layers produce by to only a portion of an image using a Layer Mask.
The various types of available adjustment layers in Photoshop
If you are making a change to an image the old-fashioned way (that is, without using an adjustment layer), but want to affect only part of the image, what do you do? You reach for the Lasso or one of Photoshop's other selection tools, right? Whatever lies within your selection will get changed by your adjustment; whatever lies outside it won't be.
This works fairly well for simple edits, but if you later want to change the selection used for the adjustment, you're out of luck. Not only has the adjustment itself been directly set into the image pixels, the portion of the image the adjustment got applied to has also been cast in stone. Sometimes, even if the section of the image that got adjusted came out perfectly, you may have to redo it because you selected too much or too little of the image before you tweaked things.
Things work much better with adjustment layers.
When you create a new adjustment layer, it will appear as a half-black/half-white circle icon in the Layers palette. But next to that icon is another one that looks like a rectangle drawn in black and white. This icon represents the layer mask for the adjustment layer and provides a way to control how much of the image will be affected by your adjustment. In essence, you get two layers in one when you create an adjustment layer.
If you make a selection and then create an adjustment layer, Photoshop will turn your selection into the equivalent layer mask. Areas within the selection will show as white in the mask icon and areas outside will show black. If you haven't made a selection before creating the adjustment layer, the entire image gets selected by default and the mask will show as a blank white rectangle. Only the portion of your image within the mask will get affected by the associated adjustment layer. The rule of layer masks is that black hides, and white reveals.
Selections with layer masks though don't have to be just pure black and white. The layer mask is actually a complete grayscale image in its own right. You can use the brush tool or whatever else strikes your fancy to manipulate the layer mask. While you can paint in black, white and shades of gray, it is often easier to just stick with black and white but change the opacity of your brush as you see fit. To the degree that each mask pixel is white, the corresponding image pixel underneath it will be selected and thus affected by your adjustment. For example, a medium gray mask pixel will halfway select what is underneath it. That may sound like a strange concept, but all it really means is that your adjustment layer will affect that image pixel by a lesser amount than it will were the mask pixel completely white. The adjustment will have fifty percent of its full potential at that point.
You can paint with black or white on a layer
mask to hide or reveal the effect of an
Manipulating foreground and background colors
If you make a mistake in painting your layer mask, don't sweat it. Just change it however you need to. As with the adjustment layer itself, your mask never actually affects your image, it just looks like it does. Both the adjustment and the mask that constrains its effect get applied on the fly as data is sent to your monitor and printer. You can therefore refine both the effect and the area being changed at any point with no loss of quality, even after you save and re-open an image.
Generally, you can refine your mask simply by looking at what your adjustment layer is doing to the image you are working on. The small rectangular mask icon on the Layers palette is really for quick reference only. It's too small for much else, after all. If you do want to see the mask by itself though, there's an easy but hidden way to do it. If you Alt-click (Option-click on Mac OS) on the rectangle icon for the mask, Photoshop will temporarily replace the image you are working on with a full-sized view of the mask. To go back to your image, just mouse click on the something other than your mask in the Layers palette.
What I've found to be the easiest way to work on a layer mask is to set the foreground color to black and the background color to white by clicking in the Tools palette. Your mask starts out as pure white, so it's convenient that the default brush color scheme starts out with black. Now pick a soft edged brush of a workable size and set its opacity to somewhere around ten percent. To lay down darker areas, just paint multiple strokes in the same area. As you paint on your layer mask, you can swap between black and white as needed by clicking on the "exchange colors" icon in the Tools palette or by using the keyboard shortcut of pressing the "X" key. Keyboard shortcuts can come in handy too if you need to change brush size or hardness as you work. Pressing the "[" left square-bracket key will decrease brush size while the "]" right square-bracket key will increase it. Holding down the shift key while pressing on these same keys will soften and harden the brush edges. Sometimes you may need a mask that is primarily black to mask its effect from the majority of the image you are working on. Instead of starting with white and painting mostly with black, you can use the "paint bucket" tool to fill the entire mask with black and start painting with white.
But really, any method you are comfortable with can be used to refine a layer mask since it reacts just like a regular layer to virtually all Photoshop tools. You can even use filters on your layer mask if you want. Most filters probably aren't too relevant, but Gaussian blur can be quite useful for softening the edges of a mask. About the only things that won't work are those affecting color since the mask is grayscale only.
Oh, and as you may have already guessed, you can't create another adjustment layer to modify your mask. Whatever modifications you make to your mask in terms of Levels and such have to be done with traditional methods. But if you do mess up, you can simply press "X" and paint over your mistakes with the alternate color.