If you read the first part of our tutorial on layer masking then you'll know the secret by now. Add a layer mask and everywhere you paint black the layer is hidden and the layer below shows through. Everywhere you paint white, the layer is visible and covers the one below it.
The title to this part gives it all away - what if you paint in grey instead of white or black? The answer is very simple - remember that white and black are just special shades of grey. Paint with a shade of grey and the layer below will show through “a bit” - the darker the shade of grey the closer it is to black and the more of the layer below that shows through. Lighter shades of grey are closer to white and so allow more of the layer you are masking to be visible.
Here's an example. I started with a picture of a red balloon (like below) and the aim of the layer mask is to edit the background of the balloon, currently red coloured, to various different and gradiented colours:
Then I duplicated the layer and used the “replace colour” tool to change the red area to blue on the top layer. My picture now looks like this:
The layers palette shows what's going on with the layers:
A quick stroke with a black brush on the layer mask and here's what I got. A stripe of the red showing through:
Here's where is gets interesting though. On this next screen grab I have painted successive stripes using lighter and lighter shades of grey. Notice as we go down the picture how the “red” balloon goes through shades of purple and finally becomes blue. That is because as the mask colour gets closer and closer to white, more of the blue shows through the red. If you remember your art classes then red + blue = purple of various shades.
You can see some of the uses of this in the examples I've posted below but stop for a moment and look at the layer mask. I painted this by hand but as you'll see it's a very crude gradient. In the toolbox we already have a much better gradient tool and we can use it on layer masks too. In fact, you can use ANY method you like of getting black, white and grey paint onto your layer mask - brushes, gradients, fills, alpha channels, even the type tools. We'll look at some of these in our next tutorial but for the moment let's just look at the gradient.
I made sure my foreground colour was white and background was black. The quick way to do this is hit “d” because they are the default colours. I clicked on the layer mask and selected the gradient tool. Then I drew a linear foreground to back ground gradient from the top of the picture to the bottom. This gave me a beautifully smooth gradient in my layer mask like this.
The picture then has a lovely smooth transition from blue at the top (where the mask is white and allows the top layer to show) to red at the bottom (where the black mask shows the layer below).
In the next tutorial, we'll look at some even more advanced features of layer masks but before then, you might like to practise on some of your own pictures. Remember always to work on a copy so your original isn't affected and remember that you can use any two layers and mask one onto the other.
Below are some images I have used grey layer masks and gradient layer masks on. With each of them I have also posted a copy of the mask so you can see just how I achieved the effect, just click on the picture to see the full picture and mask:
one |
two |
three |
four |
five
Photoshop Elements
The technique for adding gradients to layer masks is exactly the same as above, although the method used to create the layer mask is slightly different, see here for a recap.
Paint Shop Pro - Courtesy of Andrea Lane
Similarly, the technique for PSP is very similar to that of Photoshop. The idea behind how the grey layer masks work is the same, the differences are simply what palettes are used. Here is a quick walkthrough of the Gradient tool:
I made sure my foreground colour was white and background was black. The quick way to do this is hit “d” because they are the default colours.
I clicked on the layer mask and selected the gradient tool - Choose Gradient from Materials palette. Click on Foreground Colour the select the Gradient tab. Choose the Black - White gradient. You can invert it by checking the box. Paint with this using the colour replacing tool.