Creating transparency in GIMP

I have an image. The image is currently two-tone black and white: That is to say, each and every pixel in the image is either pure 0-black or pure 255-white. What I want, however, is to convert the white in the image to perfectly transparent. Should be simple enough, right? I found a few methods for doing this, but in every single method, the final step, the one where those pixels would actually become transparent, doesn’t work. If the final step is a menu option, that option is grayed out. If the final step is a push of a button such as [delete], that button does nothing. What am I missing?

It’s been a while since I used GIMP but you should be able to select all the black pixels at once. Paste that into a transparent layer.

ETA: Select By Color Tool (icon:finger pointing at color blocks)

OK, this is kind of funny… I got that to work, and created the file I wanted to create (thank you!). Then, in the process of trying to get that file to work, I discovered that I could have saved myself a heck of a lot of work, because there was a much easier way to do a better job of exactly what I wanted to do.

To wit: What I wanted to do was to be able to sign a PDF file without first printing it out. So I signed a piece of paper, took a picture of it, and then manipulated the image to get it pure black and white. I figured I’d convert that to transparent background, and copy and paste it into the PDF file. It was a fair bit of work, but I figured that since I could re-use it for later documents, it’d be worth it.

And then I discovered that Preview has a built-in tool for doing exactly that: Taking a picture of a signature, and attaching it to signature lines in PDFs.

For future reference, there’s a way to do this that will work even if you had other colors: Colors > Color to Alpha. It will even turn stuff like 50% gray to 100% black at 50% opacity, hence allowing for antialiasing.

I use it all the time to remove backgrounds from images. (Though you have to be more careful on how much of the image you select if you want to keep some areas 100% opaque.)

That was one of the menu options that was grayed out.

What you were missing was probably the first step in the process, which is to add an alpha channel to the image (menu: Layer -> Transparency -> Add Alpha Channel). After that, any method of cutting out parts of the image (whether selection by colour or just marking something geometrically) should leave transparency behind.

Nope, I did add the alpha channel, and I know that step was successful because the option to remove alpha channel became un-grayed. Could it maybe have something to do with the fact that I started by converting the image to grayscale?

That’s odd. This is a literally complete description of how I go about making everything white transparent in GIMP:

  1. Open image.
  2. Add alpha channel.
  3. Choose select by colour.
  4. Click on something white.
  5. Press Ctrl-X.
  6. Save image.

The only time I’ve had anything greyed out or similar is when I forgot to add the alpha channel. I could see the grayscaling procedure removing the alpha channel (turning to grayscale is basically converting three colour channels into one) but I haven’t managed to reproduce it.

You’re right. Color to Alpha will not be available if you are grayscale or indexed color mods. I’m not entirely sure why this is, as it has no problem automatically switching from RGB to RGBA (aka adding an alpha channel).

A lot of GIMP’s options are not available unless you are in RGB(A) mode. This may change with GIMP 2.10, which will have a complete overhaul of the color system. (Don’t ask me why they don’t make it GIMP 3.0).