I have two images (For the sake of simplicity, Image1 and Image2). I want to use Image2 as a transparency for Image1.

How can I do that? Assume I've done little more with Gimp than play with some filters.


  • 3
    Is Image2 a grayscale image? Since transparency uses a 0..255 value for each pixel, it is like a grayscale image in this respect.
    – mgkrebbs
    Commented Jul 14, 2012 at 2:25
  • 1
    For GIMP newbies like myself, the following provides the requisite background and terminology to understand this thread. Helped me anyway. Docs.Gimp, Chapter 8. Combining Images: docs.gimp.org/2.6/en/gimp-image-combining.html Commented Oct 14, 2017 at 14:21

4 Answers 4


OK, so I assume you have two images: a normal image that you want to add transparency to, and a grayscale image that you want to use as its alpha (transparency) channel, something like these:

Base image without transparency Alpha mask for image
(Base image based on this photo by John Fielding, used under the CC-By-SA 2.0 license; alpha mask created by me using the GIMP's Sphere Designer tool.)

There are several ways to do this; let me describe a few of them.

Method 1: Open both images in the GIMP. Select the grayscale image and copy it to the clipboard (Edit → Copy or Ctrl+C). On the base image, select Layer → Mask → Add Layer Mask... (also available by right-clicking the layer in the Layers dialog). It doesn't matter what you choose as the mask, since we'll be replacing it shortly.

The layer mask you just added should be selected for editing; if not, select it with Layer → Mask → Edit Layer Mask (or just click the mask in the Layers dialog). Paste the grayscale image in (Edit → Paste or Ctrl+V) and anchor the resulting floating selection into the mask (Layers → Anchor Layer or Ctrl+H, or click the Anchor icon in the Layers dialog).

Optionally, turn the layer mask into an actual alpha channel using Layer → Mask → Apply Layer Mask (but simply exporting the image as PNG will do that for you).

Method 2: Open the images as layers (File → Open as Layers...) or just paste one as a new layer into the other. With the grayscale image layer visible, open the Channels dialog, right-click one of the Red/Green/Blue channels (they should all be identical) and select Channel to Selection. Invert the selection with Select → Invert or Ctrl+I.

Select the base image layer in the Layers dialog. Add an alpha channel for it with Layers → Transparency → Add Alpha Channel if it doesn't have one already, and then cut the selection away from the layer (Select → Cut or Ctrl+X).

Method 3: As method 2, but after Channel to Selection, don't invert the selection, but simply use Layer → Mask → Add Layer Mask... on the base image layer and choose "Selection" from the dialog. Then optionally apply the mask as in method 1.

In any case, whichever method you used, the result should look like this (actual transparent PNG on left, with checkered background on right):

Merged base image and transparency, actual transparency Merged base image and transparency, checkered background

  • 3
    Method 1: a key point is to anchor the pasted image - if you haven't got the layers dialogue open it's not obvious that even if you do "paste into" the image doesn't become the layer mask until you tell it to anchor. That's what led to me searching and coming here.
    – Chris H
    Commented Dec 12, 2013 at 15:26

For "layer mask" basics, have a look at this tutorial.

Common algorithm can be:

  1. Create SomeMaskLayer with transparency.
  2. Right-click on the SomeMaskLayer and choose “Alpha To Selection(In Dock "Layers")
  3. Menu Select -> Save To Channel.
  4. Hide SomeMaskLayer. (In Dock "Layers")
  5. Create SomeRasterLayer. (File -> Open As Layers, or paint)
  6. Right-click on the top layer and choose “Add layer mask”. (In Dock "Layers")
  7. In dialog window choose Channel option, and choose your new Channel in the combo. Click Add.

Ok, now you have "live mask".

  1. Right-click -> Apply Layer Mask to baking mask to pixels. (In Dock "Layers")


  • 1
    Thanks for the tutorials. However - They assume a background in graphics, not programming. In addition, I don't get the side-panels they show when I open Gimp. Third, I already tried opening Image1 as the first layer, Image2 as a second layer and then adding a white layer mask while on the second layer. It didn't work. Commented Jul 13, 2012 at 22:25
  • Or at least, it appeared not to work. There's no real change in the image whether I invert the colors or not. Commented Jul 13, 2012 at 22:27
  • 1.about panels(Docks in GIMP): try to use Single-Window Mode: menu Windows/Single-Window Mode .... 2.probably just Docks is hidden: menu Windows/Hide Docks (or press Tab)
    – swift
    Commented Jul 13, 2012 at 23:50
  • at the new channel, I had to set "fill opacity" to 0. Also I did not "apply layer mask" because I still want to be able to change the image. I just wanted to apply transparency on specific regions on all layers. So I added the mask, with channel option, to each of the layers, and it worked perfectly, thanks! Commented Jul 9, 2014 at 20:37
  • FYI, both of the above links are spam now.
    – DrewB
    Commented Dec 26, 2018 at 18:57

@IlmariKaronen answer is correct but assumes a little bit of gimp knowledge, so I am writing a step by step guide here, so it's easier to follow for people with zero gimp knowledge. The guide assumes the alpha channel is to be found as a component of another image. First let's copy the alpha channel to be used later with the following steps:

  • Open the image you want to use as an alpha channel (or that it contains the alpha channel you want to use) in gimp;
  • From the menu, select "Color -> Components -> Decompose";
  • From the popup window, select the color model (RGB or RGBA), ensure "Decompose as layers" is checked, and "Foreground as registration color" is unchecked;
  • A new image is opened, from the layers window, delete (right click, "Delete Layer") or hide (left click on the first thumbnail button) the unwanted layers;
  • From the menu, select "Edit -> Copy Visible".

Then paste the copied alpha channel to the desired image with the following steps:

  • Open the image you want to add the alpha channel to in gimp;
  • In the layers window, select the sole layer, right click "Add Alpha Channel";
  • In the layers window, select the sole layer, right click "Add Layer Mask".
  • Initialize the layer mask to "White (full opacity)", click "Add";
  • In the layers window, select the sole layer, right click "Show Layer Mask";
  • Paste the previously copied channel into the active context (CTRL+V) and anchor it (CTRL+H);
  • In the layers window, select the sole layer, right click "Apply Layer Mask";
  • Save the project or export the image to a format supporting transparencies.

I found a way that in my opinion is better in certain situations where you may want to edit both the transparency layer and the image. An example is editing using text as the transparency mask.

  • Create a new layer group so it doesn't interfere with layers below it.

  • Put the Image as the background and the transparency mask layer as the foreground in the layer group.

  • In the layers window, select the transparency mask layer, right-click "Edit Layer Attributes"

  • Set the "Mode" to "Exclusion"

  • Set the "Composite Mode" to "Intersection"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.