Lock transparent pixels is one of Photoshop's nifty little icons that's hiding right there in plain sight on your layers palette.
As the name suggests, checking the box will lock any transparent areas in our layer, allowing us to paint only on areas where color information is already present.[Edited by User on 10/3/2012 12:07:47 PM]
Let's start by making a new PSD file. With the background layer selected, all of these options in the layers palette are greyed out. Create a new layer (Ctrl+Shift+N), and use the Elliptical Marquee Tool to make a circle.
Notice that all options are available now and we can tick the box to lock transparent pixels. A lock icon on the layer indicates that all or part of it is locked, much like the background layer.
Now select the Brush Tool (B) and using a different color, try to paint on the layer. We will only be able to paint inside the circle, while the transparent areas remain the same, making this just one of the many ways to add shadows and highlights.
Why lock transparent pixels and not just load a selection from transparency, and paint inside it?While the second method works well when our object has a clean, crisp edge, let's see what happens when using it on a feathered edge.For this purpose I have unlocked our layer (keyboard shortcut / ) and applied a heavy gaussian blur:
We now have a fuzzy circle that should looks similar to this:
After blur is applied, I lock transparent pixels again (/), and choose a different color from my palette.
Let's now fill the layer with newly picked color. Go to Edit -> Fill... (or Shift+F5, or Shift+Backspace), choose Foreground Color from the first drop down menu, and click OK.
Of course if you were lazy like I am, you could just hit Alt+Backspace and get the same result without the drop down menu :D
All opaque areas have changed color and the edges have retained opacity, and looks a lot like the results we would get from using a clipping mask. . Reselecting an object from transparency and filling the selection instead of using the lock layers method, does little to preserve initial shape and change colours with feathered edges.
Of course with Photoshop, there are always many other ways to achieve this. While locking transparent pixels is a quick and easy way to do all of the above, it does work destructively on a layer, unlike a clipping mask, but there are a few cases when this is actually needed. Thank you for reading my tutorial, and have fun using the right tools at the right time.[Edited by User on 10/3/2012 1:52:08 PM]
Your browser does not support iframes.