FYI this is using Photoshop CS5, but every version of PS I’ve ever used has had them (Since version 4. Not CS4, 4.). Lots of drawing programs have mask functions, though, so the principles will be the same.
If I can help it, I never erase things in Photoshop. I opt for masks.
↑ If you click on that button I highlighted, on any non-background layer in Photoshop, it’ll create a mask for that layer. If you happen to have a selection while you click that, the mask will be in the shape of your selection (if that doesn’t make sense, come back to this after reading the rest below).
What does a mask do? It blocks out (or …masks ;D) part of your image/layer. Take this gradient I made, for example:
Below, I used a mask to block out parts of that gradient, so they don’t show up (and the white from the layer below shows up underneath. Once a layer has a mask, you just click on the mask (circled below) to draw on it.
Don’t be alarmed if you see black and white only in your brush colors— black = the area you want to hide, while white = the area that’s showing. You should be able to do grays, too. Get out of mask mode (by clicking on the the artwork again; left of what’s circled below, for example) and you’re back in a normal drawing mode.
Okay, but why wouldn’t I just draw straight onto the layer instead?
Because, when using a mask I can modify that drawing without really changing anything/hurting the original gradient.
Right, but… If I wanted a star or something, why not just add a layer on top to draw it?
Sure, you could do that. To be fair, there are tons of way to do things in Photoshop, for sure, but what if you want some other drawing below to show through? What if you want those stripes below to show? The mask allows for the layer(s) underneath to show. Like this:
Besides, it also allows you to put back things you’ve hidden. If the shape of that star is off, for example, or if you’d generally like to have a shape that needs to be drawn more carefully, it’s much easier to draw that shape in blacks and whites, instead of painting the gradient to fit that shape. You can remove or put back things, as much as you want, with a mask.
(Plus, if you’re the type to have like a million layers in a picture, using a mask will reduce the clutter if all you want to do is hide a little piece but preserve the full layer.)
Here’s a more practical use. Say I want to change the shape of the panel borders, but my comic artwork is too big for the new panel:
A mask, in the shape of my panel, will hide the rest of the artwork, so I don’t just have to delete parts of it. (You can even mask an entire group in Photoshop):
Why’s that important?
If I want to move the art in the panel over a little, I still have the artwork. I can un-link it from the mask and move the artwork, while leaving the mask where it is:
Do even more.
See how all of this stuff overlaps? My panel borders, backgrounds, and figures are all on different layers:
With masking I can move things, remove stuff, or make edits without messing up the other parts. Just hide it all with masks:
So, if you want to make edits but don’t want to permanently change your artwork, or have to save a million duplicate layers to keep the original art, or rely on a crapload of undos, use a mask. Whatever you use them for is really up to your imagination, or something like that.
Really, there are so many more things you can do with masks than what I’ve shown here. In the future, I’ll go into that. Masks are awesome.