A very little known/underused feature of Photoshop is the Clipping Mask. Clipping Masks are used to “mask” out something so that you can only see a portion of a photograph. Unlike Layer Masks, a Clipping Mask will mask out what is in the layers above the mask, rather than below. Using Clipping Masks, you can create some really cool effects. The below picture is an example of just one of the effects you can achieve using Clipping Masks.
This image was created by taking a picture of a palm tree, turning that into our clipping mask, and then laying that below an image of a sunset by a beach. Then text was added to the top-most layer, and the image was flattened. Simple as that. So let’s get to it!
1. Setting Up Your Background
The first thing we need to do is decide on a background. That’s the part of the image that’s going to show through our mask. I decided I wanted to go for a postcard type of look, so what better scenery than a sunset at a beach? So the first thing to do is grab your base image. I went over to morguefile.com and grabbed my sunset image.
For now, the only thing we need to do with this is to double-click it to “unlock” it so that we can manipulate it later. If you like, at this stage you can rename that layer to something more descriptive like “sunset.”
That’s it for the base. Don’t worry, we’ll be going back to it shortly, but for now let’s set up the image that’s going to become our “stencil” or clipping mask.
2. Setting Up The Clipping Mask
When setting up a clipping mask, the thing to keep in mind is that the entire image is going to become a kind of stencil. Because of this, it will lose most of its details and it ends up looking more like a silhouette once you convert it to a mask. With that in mind, for this particular image I wanted to pull out just the palm tree from my source image, so I decided to desaturate it, then convert it to flat black and white so that I can more easily get the parts I want (the palm tree) and discard the rest. To do this, I used two features – Desaturate and Threshold.
First let’s take our palm tree image:
Now the first step is to discard all the color information, because we’re not going to need it. To do this, go to Image->Adjustments->Desaturate. What you’re left with is a grayscale version of the image:
Next we want to take away the shades of gray so that the image is pure black and white. To do this, we’re going to use the Threshold command which you can find under Image->Adjustments->Threshold. When you select the command, a box will pop up that will allow you to adjust the Threshold level of the image:
There is no set rule as to what numbers you should input into this box. Instead, make sure that Preview is selected, and adjust the slider to the left until you can see all the details of the palm tree. It’s okay if you have some extra black spots in there, because we can easily correct that. Be careful not to move the slider too far to the left, or you will lose too much of the palm tree detail. So after adjusting the threshold level, we’re left with an image that is pure black and white:
We’re almost finished preparing the mask, but we have one more thing left to do. Remember when I said that the entire image will act as our stencil? Well right now there is a ton of white in the picture, and if we converted it to a mask, the mask would take the shape of the entire image. Since we want a palm tree and not a big ugly rectangle, we’re going to have to remove the white.
Because we’re not overly concerned with the detail, we’ll just use a very simple method to select the white so that we can remove it from the image. To do this, we’ll use Color Range. So go to your menu bar and choose Select->Color Range. This will bring up the Color Range dialog box that looks like this:
For this tutorial, you don’t need to be concerned about all of the settings. For our purposes, all you need to do is take the eyedropper tool and click on a white part of our original image. Be sure that your Background layer is not locked. If it is, hit Cancel and double-click it and hit OK. Then click Select->Color Range again. To select all of the white in the image, just click once in any area that has white. It may appear that nothing has happened, but what you’ve done is selected all the parts of the image that contain that color selected. Click OK and you’ll be returned to your image and all of the white will be selected. You’ll know this by the “marching ants” all around the white portions. If you don’t see the selection, then just double check that your Background layer is unlocked. If it is, double-click it to unlock it and then repeat the Color Range step. Now that you have all the white selected, just click the Delete key on your keyboard to remove it from the image.
At this point, all of the white should be gone from your image and you’ll be left with a pure black palm tree and shoreline. If you have any stray black from the Threshold Level step, you can use the Eraser tool to remove it. Because there is only black in the image at this point, it will have a transparent background and the eraser tool will get rid of any extra. So now you should be left with this:
NOTE: If you need to save this image for any reason, you need to save it as either a .gif or .png file. Those two formats will preserve the transparency in the image. If you save it as a .jpg, it will fill all of the transparent areas with white and undo all your hard work.
The last thing I want to do is resize the mask so that it fills a bigger portion of the beach image. Otherwise we’re not going to see a great deal of the beach through the mask. To do this, simply go to Edit->Free Transform (Ctrl-T) and drag the handles until the mask is the size you want. Hint: if you hold down the Shift key while dragging the handles, it will constrain the proportions so that the image scales proportionately. Otherwise, you’ll stretch out the part of the image that you’re dragging.
Okay, so now that we’ve prepared the image for the mask, it’s time to actually convert it into a Clipping Mask.
3. Creating The Clipping Mask
Open your beach image if it’s not already. Next go to your palm tree mask image and click Select->All (Ctrl-A), then choose Edit->Copy (Ctrl-C), and finally Paste it into your beach image (Edit->Paste or Ctrl-V). You can close the mask image at this point, as we don’t need it any longer.
So now you should have two layers in your beach image. The bottom layer should be your Background with the beach in it and the top layer should be your palm tree that you just pasted in:
If your beach layer is locked (like mine is in the screenshot), then double-click it and hit OK. Now it’s time to convert that palm tree layer into the clipping mask.
The first step is to take your beach layer and drag it ABOVE the palm tree layer. I know this may not make much sense but if you remember at the start of this tutorial I mentioned that a Clipping Mask will “mask out” what is in the layers above the mask as opposed to a Layer Mask that hides what is below it.
So now that you’ve moved your beach layer above your palm tree layer, it’s time to apply the mask. There are two different ways you can do this. Either way works the same, it’s just a matter of personal preference.
The first method is to right-click on the beach layer and choose Create Clipping Mask. You’ll notice that the beach layer is now indented with a little arrow pointing down to the layer that is masking it:
The other method to creating a Clipping Mask is a little different. You drag your background layer above the mask layer as before, but instead of right-clicking and choosing Create Clipping Mask, you’re going to hold down the Alt key and move your cursor in-between the two layers. The cursor will change into an icon that looks like two little circles:
Just click once while the cursor has that icon and it will create the mask the same way the other method did. Again, you’ll see the beach layer indented with the arrow pointing to the mask layer.
You should also notice that your beach has now disappeared and only the portion where the palm tree is can be seen. Congratulations! You’ve just created a Clipping Mask.
At this point you may want to use the Move tool and move the palm tree around to your liking. I opted to put it towards the left side of the image so that you can just see the sunset peeking through the right edge. I want to be able to add text later on and I don’t want it to look too crowded. It’s purely a matter of taste, though.
No matter which method you used to create the Clipping Mask, by now you should have an image that has a palm tree clipping mask that your beach layer can be seen through. The hard part is over, but we still have a little tidying up to do.
4. Text Layer and Finishing Touches
Right now your image has a large portion that is transparent. In order to complete the “postcard” look like in my example, just add a new layer (Layer->New->Layer or just click on the New Layer button in the Layers palette), and fill it with white. Then drag it all the way down to the bottom of your layers. Now you end up with something that looks like this:
It’s looking pretty good at this point. The last thing we need to do is add our text. Simply click on the text tool, choose a font that is appropriate for your image (I chose Gill Sans Ultra Bold Condensed at 48pt size), and drop in your text. After that, position the text where you want it, drag the text layer all the way to the top, and you’re done! I like to flatten the image (Layer->Flatten Image) when I’m satisfied with it and I know I’m not going to be making any more changes to it. This is the final image that we ended up with:
I hope you enjoyed this tutorial. If you have any questions, feel free to leave a comment below. As you can see there are some cool effects that you can achive with the Clipping Mask feature of Photoshop. Keep in mind that you don’t have to use an image for the mask. You can even convert a text layer into one! Experiment on your own and see what you can come up with.