Rocky mountain peak reflected upside-down in still water beneath a dramatic cloudy sky, illustrating an amazing trick for refining masks in Photoshop.
  • Amazing Trick For Refining Masks In Photoshop

  • Aaron Nace
    by Aaron Nace
    July 18, 2013
  • Add to
    favorites

description

The Brush Tool set to Overlay blend mode is one of the most powerful mask-refining tools in Photoshop, because pure white and pure black pixels are immune to it. This tutorial replaces a sky and its lake reflection, using a duplicated Blue channel pushed hard with Curves to decide the edges, then the Overlay brush to clean up everything in between without touching a single pine branch.

Mountain lake composite with a replaced sky, made using refined channel masks

An Amazing Trick for Refining Masks in Photoshop

Amazing Tricks

Photoshop has an impressive arsenal of tools for creating and refining masks. But one of them is so powerful, so nearly magical in its application, that you’ll wonder why you never knew about it. It’s the Brush Tool — with one small quirk: the Brush Tool with its blend mode set to Overlay. That single change lets you clean up masks dramatically and easily, even in areas with complex edges like hair or tree branches.

The Two Source Images

The base image is a photo taken in the incomparably beautiful Ansel Adams Wilderness in California: a dawn shot of Mt. Ritter and Banner Peak reflected in the still waters of Garnet Lake. The landscape has a certain majesty, but the sky could use more oomph, so we’ll add dramatic clouds photographed in Death Valley.

It matters that in both photos the light comes from the same direction — behind the camera and fairly low down — and that the focal length of each is approximately the same.

Mountain lake reflecting golden sunlit peaks and pine trees, a source image for a mask refinement composite

Dramatic stormy sky over a flat desert basin, a source image for a mask refinement composite

Since the sky in the Banner Peak photo is a little tight, first add some empty space with the Crop Tool to expand the canvas, then paste the clouds in as a new layer on top.

Hand-drawn 'Empty Space' text logo composited over a mountain lake photo, demonstrating mask refinement around text edges

Composite of a stormy desert sky over a close-up of a rocky pool, combined using refined masking

Why Quick Selection Won’t Work Here

Now it’s layer mask time. You could use something like the Quick Selection brush to select the blue sky and build a basic mask for the cloud layer, but the problem shows up immediately: the sky in the mountain photo, boring blue though it is, is actually very complex. Those trees stick up into it and create detail the Quick Selection Tool will never handle.

Josh Cripps Refining Masks in Photoshop

I hear some of you in the back saying “use the Color Range tool!” We could, but it isn’t a very clean selection method and tends to create blockiness and posterization, especially when editing 8-bit JPEGs.

Making the Initial Selection from a Channel

Instead, use Channels. The trick is to click through each channel — Red, Green, Blue — in the Channels palette and find the one showing the greatest contrast between what you want to select (the blue sky) and everything else (the mountains, the trees). Here the Blue channel gives the most contrast between sky and landscape.

Josh Cripps Refining Masks in Photoshop

How a Channel Becomes a Selection

When you turn a channel into a selection using the Load Channel as Selection button at the bottom of the Channels palette, everything pure white becomes 100% selected, everything pure black is 0% selected, and the grays in between are selected proportionally to how bright they are.

So loading this Blue channel as it stands selects the sky almost fully and the trees barely at all, which is what we want. But the mountains are fairly light gray, meaning they’d be partly selected too, and that’s no bueno: the clouds would bleed into the mountains.

Boosting the Channel’s Contrast with Curves

What we need is more contrast in the channel. Curves adjustments can be applied to channels, so the Blue channel can be made far more contrasty — but adjusting it directly would change the image’s overall color balance. Instead, copy the Blue channel first by dragging it onto the Create New Channel button at the bottom of the palette.

That creates an alpha channel called Blue copy. Press CTRL or CMD + M for Curves, then crank the brights up and the shadows down to greatly enhance the contrast of this alpha channel.

Josh Cripps Refining Masks in Photoshop

This is a much better starting point, though still imperfect: some tones in the mountains and foreground remain gray and will be partially selected. Create the mask anyway so you can see what you’re working with. Load the Blue copy channel as a selection, then go back to the Layers palette, make sure the cloud layer is selected, and click Add Layer Mask.

Josh Cripps Refining Masks in Photoshop

Josh Cripps Refining Masks in Photoshop

Josh Cripps Refining Masks in Photoshop

Cleaning Up the Mask, Brute Force First

The image is looking a little weird. The blue sky was replaced, but bits of cloud are showing through the mountains and the foreground reflection.

Alt or Option click the layer mask thumbnail so you can see the mask itself. Then grab the Lasso Tool and make a selection covering the entire bottom half of the image, roughly paralleling the tops of the mountains.

Josh Cripps Refining Masks in Photoshop

Fill that selection with black using SHIFT + F5, or Edit → Fill.

Josh Cripps Refining Masks in Photoshop

Where Overlay Mode Comes In

Pretty good, but the edges of those mountains still need work. This is where our wonderful friend Overlay mode arrives. Grab the brush, make sure black is your foreground color, and start painting.

Josh Cripps Refining Masks in Photoshop

Oh shoot, what did we do? Right — the brush is still in Normal mode, so of course it made a normal splash of black. Undo that, then use the drop-down in the toolbar to select Overlay.

Josh Cripps Refining Masks in Photoshop

Now try that brush stroke again.

Josh Cripps Refining Masks in Photoshop

Why It Only Affected the Mountains

The stroke affected the mountains and had zero effect on the sky. ZERO. In Overlay mode, painting with something brighter than middle gray brightens the underlying pixels, and painting with something darker than middle gray darkens them. But the meat and potatoes of Overlay mode is this: whether you’re darkening or lightening, pure white and pure black pixels are unaffected.

Because we increased the contrast of the Blue copy channel, every sky pixel in the mask is pure white, so you can paint over them as much as you like in Overlay mode and they will never change. Knowing that, paint over the rest of the mountain to produce a final mask like this:

Josh Cripps Refining Masks in Photoshop

Now is that a mask or what? Look at the complexity and the detail — all those nooks and crannies preserved in the mountains and even in the branches of the trees. Alt or Option click the layer mask thumbnail again and you’ll see a much cleaner sky.

Josh Cripps Refining Masks in Photoshop

The cloud mask is razor sharp, but the color of the clouds isn’t quite right. Add a Curves Adjustment Layer to increase the red in the highlights, then clip it to the cloud layer (right-click the Curves layer and choose Create Clipping Mask) so it affects only that layer.

Josh Cripps Refining Masks in Photoshop

Fixing the Foreground Reflection

One glaring issue remains: the foreground is still reflecting the blue sky from the original photo. Fixing it takes almost the same steps as before.

Duplicate the cloud layer, and the clipped Curves layer too so the color matching survives. Flip the clouds vertically, pull them down to the bottom of the image, and add a little perspective distortion to match the wide-angle distortion of the original photo.

Josh Cripps Refining Masks in Photoshop

Josh Cripps Refining Masks in Photoshop

With the cloud reflection in place, add a layer mask to it and fill it with black to conceal the clouds completely. Holding Alt or Option while clicking the Add Layer Mask button does this in one step.

Painting Directly on the Channel Instead

With the clouds fully masked out, they need painting back in selectively. Again, Channels make the selection, and again we want the channel with the greatest contrast between the blue sky reflection and everything else. The Blue copy channel made earlier is an outstanding candidate because of its high contrast.

What makes it especially good is that the foreground rocks fade from black to white, which means the clouds will fade gradually into the rocks and the water keeps its transparency.

Josh Cripps Refining Masks in Photoshop

This time we’ll do it the other way round, just to show another technique: paint directly on the channel in Overlay mode first, then create the mask afterwards. To avoid changing the Blue copy channel in case it’s needed again, make a copy of it, which Photoshop names Blue copy 2.

With Blue copy 2 highlighted in the Channels palette, take the Overlay brush and darken all the mountains, trees and rocks in the midground. Leave the foreground rocks alone, and don’t worry about the rocks sticking up out of the water — this mask is only for the reflection, so nothing outside it matters.

Josh Cripps Refining Masks in Photoshop

Now turn the channel into a mask. Click Load Channel as Selection in the Channels palette, then head back to the Layers palette. Since the reflection already has a layer mask filled with black, take a white brush — switching the brush’s blend mode back to Normal — and paint in the areas where the clouds should appear. Building the mask this way gives even more subtle, selective control. Here a large soft brush at around 30% opacity gradually painted the clouds into the reflection.

Josh Cripps Refining Masks in Photoshop

And here’s the image with the reflected clouds masked in. Note how the water still looks transparent even though the sky reflection was completely replaced.

Josh Cripps Refining Masks in Photoshop

Correcting the Color

Because the clouds weren’t painted in at 100% opacity, a little blue still leaks through from the underlying layer. That’s an easy fix: in the Curves layer above the clouds, select the Blue channel and drag it down slightly to pull the excess blue out of the reflection.

Josh Cripps Refining Masks in Photoshop

Adding Pop with a Gradient Map

We could stop there, but having replaced the sky and the reflection, why not add more color and contrast? A quick and fun way to do that is a Gradient Map. Add a Gradient Map Adjustment Layer and choose a couple of colors in the properties window — here the gradient runs from purple to light yellow. You can add as many colors as you like and change each one, so fiddle around until you find something you like.

Josh Cripps Refining Masks in Photoshop

Then change the Gradient Map’s blend mode to Soft Light, which boosts the contrast of the image and lessens the impact of the colors.

Josh Cripps Refining Masks in Photoshop

Final Result

The result is an image with plenty of pop and a groovy color scheme. And voila, we’re done.

Josh Cripps Refining Masks in Photoshop

Thanks for taking the time to read this tutorial, and I hope you enjoyed it. Until next time, happy shooting.

More Free Photoshop Tutorials

Why the Overlay Brush Works

Every other way of cleaning a mask forces you to be accurate, which is impossible along a ridgeline of pine branches. The Overlay brush removes the need for accuracy instead of demanding it: because pure white and pure black are immune to the blend mode, a high-contrast channel has already decided the edges for you, and your brush can only act on the ambiguous grays in between. You get to be sloppy in exactly the places where sloppiness is safe, which is why a mask that would take an hour with the Pen Tool takes a few strokes here.

Final Thoughts

To refine a mask in Photoshop, duplicate the channel with the most contrast between your subject and its background, push that contrast hard with Curves so the extremes go pure white and pure black, load it as a selection, then set your Brush Tool’s blend mode to Overlay and paint. The pure areas stay untouched no matter how carelessly you paint, and the complex edges survive intact.

Master Photoshop, Lightroom and Photography

Join PHLEARN PRO for $12.99 a month, or $99.99 a year (save 36%). Cancel anytime, with a 30-day money-back guarantee.

As featured in
  • 500px
  • Adobe
  • Fstoppers
  • HuffPost
  • Inc.
  • PetaPixel