A Simple Explanation of Layers and Masks in GIMP or Photoshop

After reading many examples and explanations of layers and masks, they all struck me as confusing. Now, if you have read my blog before, you’ll probably know I do a lot of things while tired. I was reading tired too. But even when I haven’t been tired, for some reason it always goes over my head.

I’ve been looking for a VERY basic explanation, in simple terms. Perhaps I haven’t looked hard enough, but I hadn’t really found one. That is, until I found an article on recreating depth of field via Photoshop.

Suddenly, layers and masks sounded SO SIMPLE and super easy. But, since it referred to Photoshop, I initially felt like I couldn’t do it. However, the idea is mostly the same so I’m going to give you a run down in GIMP instead (technically, the instructions are pretty much the same for either).

These instructions assume a very basic knowledge of GIMP (or Photoshop) functions.

1. Open a picture in GIMP or Photoshop. For this example, we’ll use an easy pumpkin patch photo. You can download and use the same photo by clicking here. (Right-click the link, choose “Save Link As…” in Firefox or “Save Target As…” in Internet Explorer and make sure you know which folder you save it to.)

Layer and mask demonstration using GIMP

This will be our base photo. I took it so don’t worry about licensing.

2. Make sure that you have the Layers dialog open. If not, go to Windows > Dockable Dialogs > Layers.

3. Right-click your base image (titled “Background”) in the Layers dialog and click “Duplicate Layer”.

Duplicating a Layer in GIMP

This new one will be our Black and White layer.

4. You should now have two layers, “Background Copy” and then “Background”.

5. Double-click the “Background Copy” text and rename it to “Black and White”. This isn’t necessary, but it’ll make it easier to distinguish between the two.

5. Click on the “Black and White” layer to select it.

6. Click on the “Color” menu at the top and choose “Desaturate”.

GIMP Color Menu Desaturate Dialog Box

The Lightness option will probably produce the best results for our purposes. You won’t see this box if using Photoshop.

7. Click “OK”.

8. Right-click the “Black and White” layer and choose “Add Layer Mask…”

9. Choose “White (full opacity)” and click “Add”. Notice a little white box show up next to the “Black and White” layer. This is your mask.

GIMP Add Layer Mask Dialog

For this demonstration, we’ll use white instead.

10. Now we’re going to use the paintbrush tool on the “Black and White” layer. Make sure you’re painting in black. Paint over the foremost pumpkin. As you paint on it, you should see orange show through. In the Layers dialog, you should see black show up on the little white mask image.

GIMP Black Full Transparency Layer and Edit Mask

The orange on the image is depicted in black on the white mask image.

11. Finish coloring in the pumpkin using whatever brush makes it easiest on you. You may want to increase the brush size for the main part of the pumpkin then use a smaller brush for the edges.

12. If you make a mistake and paint into the other pumpkins, change your brush color to white. It will act as an eraser for your mistakes.

A simple usage of layers and masks in GIMP.

Notice the pumpkin shape on the mask in the Layers dialog.

13. If you want to see the mask at full size, right-click it and choose “Show Mask”. If you ever run into a problem with editing the mask, right-click it first and make sure “Edit Mask” is still checked. (It will un-check if you switch layers. These two options are only available in GIMP.)

Black transparency mask in GIMP

This is the mask at full size.

14. When you are satisfied, right-click the mask and choose “Apply Layer Mask”. This will remove the mask image and you will see where you have created transparency in the “Black and White” layer.

Layer transparency created with a mask in GIMP

This would be easier to see if I’d done it against the color pumpkin. Sorry.

15. Last but not least, right-click the “Black and White” layer and choose “Flatten Image”.

Notice before we flatten the image, we have 2 layers still. One is our black and white layer with transparency added. The next is our base image and colorful layer. After we flatten the image, we are left with only one image layer and it is a colorful pumpkin against a field of gray.

Our final product in our layer and mask how-to.

This pumpkin was a rebel.

Had we done the same thing with a black mask, we would have painted over the pumpkin with white. The end result would have been one black and white pumpkin surrounded by lovely orange ones.

There are a variety of different mask types. White makes the masked layer fully opaque and black changes parts of the mask to transparent. Black does the exact opposite, making the masked layer fully transparent. Coloring white over it reveals that part of the white layer, making it fully opaque.

Likewise, you can use grayscale masks and paint over a mask in shades of gray for other effects. If I were to have colored over the white mask in gray, instead of black, the pumpkin would have been only orange-ish instead of bright orange.

Layers and masks are used for many things beyond color changes. You can recreate the depth of field photography effect with the same process. Instead of desaturating our “Black and White” layer, we would have blurred it instead (using Gaussian Blur, or Focus Blur to mimic Photoshop’s “Lens Blur”). Then we would have colored over the front pumpkin to reveal a sharp, clear pumpkin that would appear far away from the others.

Layers and masks can also be used to merge images together. If you had an image of a person bent over, you could arrange the two images to make it appear as though a person were bent down next to the pumpkin.

These are very basic uses, and there are many more fancy uses for these features. But hopefully this helps you gain a better understanding of how layers and masks work as well.

They aren’t, and don’t have to be, as complicated as I once thought. 🙂

This entry was posted in Blogging, General Techie, Intermediate, Photo Editing, Photography and tagged , , , , , , . Bookmark the permalink.

3 Responses to A Simple Explanation of Layers and Masks in GIMP or Photoshop

  1. Harbor Galaxy says:

    Thanks for such a clear explanation. I’ve been searching for something like this for quite a while.

  2. Heather says:

    I’m happy to hear it helped! Thanks so much for your feedback.

  3. Pingback: The Fifty Dollar Mistake Anyone Can Make And You Can Avoid | Techie Beginners

Tell Me What You Think

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s