• About
  • Contact
  • What People Are Saying

Gimp Layer Mask

Aug1st
2010
19 Comments Written by Daniel Veazey

NOTICE: I have posted a new tutorial explaining the basics of layer masks. Check it out here.

Here is a way to use layer masks and the paths tool to merge parts of two photos into one composite image. We’ll start by taking two photos of a television, using a tripod to keep the position of the camera exactly the same. We won’t use a flash, so the first photo will have a slower shutter speed to get the correct exposure on everything around the TV. However, this makes the image showing on the TV way overexposed and blown out. So we’ll take a second photo with a much faster shutter speed to get the correct exposure on the screen.

We will use Gimp to put these two photos together. We’ll open both photos as layers. You can click on File -> Open as Layers, or you can press Ctrl-Alt-O. On the layers palette, we’ll name the two layers “screen” and “room.”

Even though I used a tripod, my two photos don’t line up exactly, so I’ll need to correct that.

I put the screen layer above the room layer and set it to a low opacity. Then I used the move tool to get it lined up correctly.

Now I reset the opacity on the screen layer to 100% and move that layer below the room layer.

Right-click on the top layer and choose “Add layer mask.” In the box that pops up, choose to fill it with White (full opacity). On the layers palette, you’ll see a small white box next to the thumbnail of the top layer, and it will have a white border around it to indicate that it is the part of the layer you are now working with.

Here is some information about layer masks, from the Gimp documentation:

A transparency mask can be added to each layer, it’s called Layer mask. A layer mask has the same size and same pixel number as the layer to which it is attached. Every pixel of the mask can then be coupled with a pixel at the same location in the layer. The mask is a set of pixels in gray-tone on a value scale from 0 to 255. The pixels with a value 0 are black and give a full transparency to the coupled pixel in the layer. The pixels with a value 255 are white and give a full opacity to the coupled pixel in the layer.

Use the paths tool to draw around the edges of the screen. My tutorial on how to use the paths tool can be found here. Make sure you get the path right along the edge of the screen. It doesn’t hurt to get some outside the screen, but you want to make sure the blown out image is completely within the path you’re drawing. Then in the tool dialogue, click the “Selection from path” button.

Choose the paint bucket tool and make sure the foreground color is black. Click once inside the selection border. This fills the selection with black. But because we’re working on the layer mask, it simply makes everything on that layer, in that selection, invisible. So the image on the layer below now becomes visible through the “hole” we created in the layer mask above it.

Now we can flatten our image under the Image menu, and there we have our composite image with the correct exposure for both the TV screen and the areas around it.

Be Sociable, Share!
  • Tweet

Related posts:

  1. Everything You Need to Know About Gimp Layer Masks
  2. Gimp Tutorial: Super Groovy Wallpaper Part 2
  3. The best way to make a vignette in Gimp
  4. Tilt-shift simulation in Gimp
  5. Using High Pass Filter To Sharpen Images In Gimp
Gimp, Photography    Gimp, layer mask, paths tool, Photography
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
← Using keyframes in Kdenlive
Building a “Fish Attractor” →

18 Comments

  1. Alexander Barkoff's Gravatar Alexander Barkoff
    August 1, 2010 at 2:27 pm | Permalink

    how does this translate to Photoshop?? I am not familiar with Gimp but is the process similar in CS2?
    Thanks,
    Alex

  2. Daniel Veazey's Gravatar Daniel Veazey
    August 1, 2010 at 2:31 pm | Permalink

    I haven’t used Photoshop in a long time but, from what I remember, I think the steps would be very similar.

  3. Lillian's Gravatar Lillian
    November 14, 2010 at 2:13 am | Permalink

    Thanks! I wasn’t really look for this but it showed me something I would not have known if I hadn’t seen this. Thanks!

  4. Daniel Veazey's Gravatar Daniel Veazey
    November 14, 2010 at 11:56 am | Permalink

    Glad I could help :)

  5. conipopescu's Gravatar conipopescu
    January 30, 2011 at 11:32 am | Permalink

    Thanks, this helps me understand how layer mask works.I was having trouble with the mask tool.

  6. Daniel Veazey's Gravatar Daniel Veazey
    August 20, 2011 at 8:44 am | Permalink

    Thanks for commenting. :)

  7. GL's Gravatar GL
    January 22, 2012 at 12:42 pm | Permalink

    Thanks for the tutorial, I’m new to GIMP, so please forgive me if I’m asking stupid questions.
    Why is it necessary to create a layer mask to the layer? Will I achieve the same result by just doing the path selection and delete the inside area on the main layer so that the second layer underneath can be visible?

    Thanks!!

  8. Daniel Veazey's Gravatar Daniel Veazey
    January 22, 2012 at 12:52 pm | Permalink

    Yes, you could do that and it would work fine. One point of using a layer mask is to preserve the part of the image that you’re masking, in case you want to change it later. One of the great things about GIMP is that there is always more than one way to do something. Thanks for leaving a comment.

  9. Shaun's Gravatar Shaun
    April 20, 2012 at 5:21 am | Permalink

    Very helpful in making me understand the concept of layer masking. Thanks much.

  10. Igor's Gravatar Igor
    July 25, 2012 at 3:36 pm | Permalink

    I love you for making Firefly your example :)

  11. Julian's Gravatar Julian
    October 16, 2012 at 1:24 am | Permalink

    I was wondering, is there any way to apply layer masks to animated GIFs? Like, keeping the background layer visible but only making a section of the animated GIF, well, animated? Might be a bit of a big question.

  12. Daniel Veazey's Gravatar Daniel Veazey
    October 17, 2012 at 7:53 pm | Permalink

    I think tutorial might be helpful to you:

    http://bavatuesdays.com/isolating-animation-with-masked-layers-in-gimp/

  13. Jason's Gravatar Jason
    October 24, 2012 at 2:57 pm | Permalink

    +1 Bazillion points for changing the image on the screen to Serenity. FireFly FTW!

  14. alry's Gravatar alry
    February 4, 2013 at 5:55 pm | Permalink

    Why would you use one of the most complicated things you could think of – initializing TWO files and merging them – in a TUTORIAL??? Ridiculous. How about just getting the layers to SHOW UP and work with BASICS?

  15. Erlend's Gravatar Erlend
    February 5, 2013 at 7:19 am | Permalink

    Thanks for posting this tutorial. I was looking to take the GIMP to the next level, and this is a great introduction to working with masks.

  16. Renan's Gravatar Renan
    March 11, 2013 at 8:06 pm | Permalink

    Finally I get layer masks :) Thanks!

  17. Kamjori's Gravatar Kamjori
    May 12, 2013 at 6:32 am | Permalink

    Very good. The tutorial is in simple clear English. Not all ‘experts’ in GIMP (such as those who wrote the GIMP Bible) have the ability to explain things in simple straightforward language. Reading about layer masks in the “Bible” left me confused; this tutorial leaves me with immediately useful and clear knowledge! Much appreciated.

  18. Daniel Veazey's Gravatar Daniel Veazey
    May 12, 2013 at 6:35 am | Permalink

    Thanks, Kamjori!

  1. My Japanese Life (assemblage) « Serenblip's Blog on July 26, 2011 at 9:55 am

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Why you should leave a comment

1. I read all the comments.
2. I reply and answer every question.
3. I always click through to see the sites of commentators.
4. Because you can.
5. You become a participant instead of just an observer.

EvoLve theme by Theme4Press  •  Powered by WordPress Daniel Veazey
Things I find interesting