Ever removed a background in Photoshop, only to find want to use parts of that background later? Layer Masks and Vector Masks are the elegant and often misunderstood answer to this common problem. Keep reading to see how they work.
In this article, we’ll learn exactly what a Layer Mask is, and two methods to use them in practically any version of Photoshop, including a simpler example for less experienced Photoshop users, and another for more seasoned users who are comfortable with the Pen tool and vectors.
What is a Layer Mask?
Layer Masks, put simply, are like a hidden layer that tells Photoshop where to “hide” the information in your chosen layer. To be more exact, it’s an “alpha channel” used to mask out the image information you want to hide. Because this information is in another channel separate from the image in your layer, you can revert to your original, unmasked layer at any time. As you can imagine, many Photoshop users prefer Layer Masks to simply deleting information with the eraser tool.
The Simple Method: How To Use Layer Masks
Start with an image appropriate for background removal. This image and hundreds like it are available on Wikipedia under Wikipedia Pictures of the Day. Simply use your own if you have photographs you wish to mask.
Make a copy of your background layer by right clicking on it in your Layers Panel. By default, it will rename your new layer to “Background copy.” For nearly all situations, this is fine. Click OK.
Click the to hide your original Background layer as shown on the above left.
You can then click the icon to create the blank mask on your layer. Make sure your layers panel looks like the image on the right to ensure your have a blank mask ready and selected and your background layer successfully turned off.
Press to select the Brush Tool. Right click somewhere in your image to adjust your brush hardness and size. The default “Hard Round” brush is a good setting for this, as well. Otherwise, note the 100% Hardness setting shown above.
|Hint: Check your Foreground/Background colors before you do anything. You’re going to want to paint with a foreground color of black and keep a background color of white. You can always press “d” on your keyboard to ensure you revert to the proper 100% black and pure white.|
Simply paint into your new mask, and all areas you paint over will vanish, masked away to the background.
Exactly how is this different than using the Eraser tool? Masks, as stated earlier, can be turned off or deleted, allowing users to return to their original image.
Simply right click on the mask you’re working in in your layers panel. You’ll be given this contextual menu, where you can “Disable” your layer mask, delete it, or “Apply” it, which uses the mask you’ve painted to delete your masked information.
Beyond that, painting out your information with layer masks is no more complex than using the Eraser tool. Carefully paint around your object to remove it.
It helps to start with the most difficult areas closest to your object before removing the bulk of your image.
Once your most difficult areas are finished, you can use a larger brush to mask out the areas you don’t want.
Voila, your image is complete and masked for use anywhere you please. Not satisfied? Here’s an advanced method using vector masks.
Using Vector Masks to Remove Backgrounds
If you’ve never used vectors or the pen tool in Photoshop, this is going to be a frustrating how to for you. Less seasoned readers may want to learn about the difference between Vectors and Pixels, or brush up on the Pen tool before going forward.
Vector masks are not very different from Layer Masks, except that they use vector primitives to create their Alpha mask channels. To create these vector primitives, we’ll have to use the Pen tool to create a work path we can mask our layer with. Start by creating a copy of your background, as done in the previous method.
Press to select the Pen tool. Simply draw your shapes around your object as best as you can. Keep to the outside perimeter and ignore any shapes inside the object for now.
Don’t worry about getting every blurry pixel into your work path. Since you’re creating masks and not deleting information, you can consider less to be more. It’s more important to draw vectors that represent the object well—not ones that capture every smeary pixel.
Trace the entire object around and connect your last point to your first one to create an enclosed object. This is absolutely important and vital to the next steps, where we’ll add the holes and gaps within the object.
If your work path is complete and connected to itself as a complete, contiguous shape, you can draw in the little fiddly shapes and gaps that pop up inside the object without problems.
Draw in all the shapes inside the object in the same work path. You should have handsome vector lines around your object similar to these.
Navigate to Layer > Vector Mask > Current Path to create a Vector Mask from your current Work Path. Your active work path will become a Vector mask, and remove the background from your object with no additional steps!
From there, you can do any absurd thing to your image you care to, changing backgrounds and scaling your vector object to all manner of ridiculous sizes. Have fun working with layer masks and removing those complex backgrounds!
Have questions about Photoshop? Contact the author at email@example.com with all your Photoshop and Graphics Geek needs. You never know when your question could be featured as the next great HTG article.
Image Credits: Citrus Swallowtail by Muhammad Mahdi Karim, released under GNU License. Black Phoebe by Matthew Field, released under GNU License. Image of Andromeda Galaxy is in the public domain, created by NASA .
- Published 01/17/11