Program(s)+version: Photoshop CS5
Involves: Layer masks, lasso tool
Translatable: should work in all programs/versions that have layers
and allow to create layer masks
Steps: about 6 for the example, the rest is a guide more than a step-by-step tutorial
Difficulty: Beginner
A little guide on how to do layer masks and an example on how to change the background of an image using them.
Using Layer Masks in Photoshop
- A Basic Guide -
Since layer masks are a very essential part of my icon and/or graphic making process,
here's a small roundabout on what they do and how you can use them e.g. for getting
rid of the background in an image.
What layer masks do
Using layer masks is the undestructive way of "erasing" pixels from your image.
With the eraser in Photoshop, you literally delete parts of your image, meaning you lose
them for good. With a layer mask, you just "hide" the unwanted parts of your image; you
make them invisible. The advantage of this is that you can always go back and make
corrections to your mask if you accidentally made a mistake but didn't notice
until the very end. For example, you cut a person out from it's background
and after you're almost done, you notice that the person somehow lost it's
nose in the process and you want to get it back. If you used the eraser, you'll
have a big problem now, you either have to live with your poor noseless soul
(sorry, it's a really crappy example, I know) or do all the hard
work again. With a layer mask on the other hand, you can just go back and make
those parts of the image magically reappear again.
Basicly, this is just the long-winded way of me saying that the eraser is evil.
Layer masks are the good guys, and they can be used for a lot of things
once you've understood the basic principle of them.
How to create a layer mask and how it all works
To create a layer mask, you just have to select the layer containing your image
and then go to this little button here, right underneath the layer palette:
This will create a layer mask for this layer, you can see this by having a
look at the layer palette, there should have appeared a white filled rectangle
right next to the thumbnail of your image:
If you click the white rectangle, the "mask", you can simply paint on it using a
brush. When you paint on it with black, these areas of the image will become
invisible. Painting with white on it reveals the image again. Painting with
grey will make the image gradually more transparent, depending on the
shade of grey you use.
It's not that difficult after all, is it?
Instead of using a brush to paint in the mask, you
can also make a selection on it and fill this selection with black or white
or grey. I will use this method in the following example.
An example:
How to use a layer mask to change the background behind a person
Note: You can use this technique on larger images as well as on icons.
I am using a mid-sized graphic here for better visuality.
I have an image with a person and I want to put that person onto a different
background, a texture for example. To do this, I create a layer mask
as described above, then I use the lasso tool
to make a selection around the person:
It will be easier if you zoom in a bit to do this, although it doesn't have to be
perfect at this point.
When I'm done with the selection, I invert it by pressing Ctrl + Shift + i
on the keyboard, so the marching ants will now cover the background instead of
the person.
You could have made the selection around the background from the
start, of course, but I find it a lot easier to do it this way around.
Now, making sure that I have selected the layer mask-thumbnail in the layer palette
(and not the image thumbnail), I fill my selection with black and the background will vanish.
This is how the image and the layer mask are supposed to look like:
Now I can drag the texture that I want to use as a background underneath my image
to see it how they blend together - for demonstration purposes I will just use
an ugly dark purple color fill layer instead of a texture here; you should
obviously aim for something prettier than that:
You can see that my selection was not very good to begin with, you can still see
some light blue lines where the sky from the original background shines through.
So that means that there's still some work to do.
To finetune the mask, I zoom in a lot (to about 200-400% or more) and use a very
small brush (1-3 pixel, sometimes more; it depends on the image size that you
are working on) to paint in black over these light blue lines to make them
disappear. Again, you have to paint in the mask here, not onto the image.
When I think I'm done, I zoom out to 100% to see how it looks:
It's a lot better than before, but I still don't like the hard edges on the
right side of the armour, especially on the right shoulder, it still looks
like an obvious cut-out to me. So, I go and zoom in again and do the same as
before, but this time I will use a larger and less hard brush to carefully
paint over these parts with black to - hopefully - blend them in a little better:
And finally, it looks good enough to me:
Adding a quick coloring and a more beautiful background
(texture here by
spooky-window) might give us this, for example:
Of course, there's a lot more that you can do with layer masks, these are just
the very basics and a rather simple practical example. You might want to
experiment a little for yourself, painting on the mask with different kinds
of brushes, changing the opacity of it, using harder or softer brushes,
using a gradient... well, and whatever else you can think of.
Additional info:
If you're photographically interested and want to dig really deep into the realms of masking and see what great things can be achieved with them, I recommend a read of
this very amazing tutorial by Tony Kuyper.
You most definitely won't want or need this for creating something as small
as icons or simple fanart, but if you work with larger graphics and especially with photographs, this can actually be a lot of fun to play around with.
Well, and that's it. I hope I didn't forget anything important and as usual,
if something I said doesn't make sense or you have further questions, just ask. :)