How to convert solid color to transparency?


Question

I have a simple black and white image. I want to remove the white background and make it transparent. There are some intricate parts so the magic wand tool won't work for me in this case. Is there a way I can select a color and remove it (making it transparent)? Here's a sample of the image:

black and white image example

I'm currently using Pixelmator, but have access to Photoshop. Also, I would think all of these programs would have a similar tool for doing this, but I'm not familiar with it.

1
5
7/1/2013 5:38:00 PM

Accepted Answer

Pixelmator

If you would like to make a white background transparent, you can use the "Mask to Alpha" tool. However, this tool assumes that the dark part of the image is what you want to make transparent. You will first need to invert the color so that the white is turned black:

Menu > Image > Invert Color

Then you can convert the black to transparent:

Menu > Filter > Color > Mask to Alpha

Update June 2018: The menus have moved around a little bit since the last time I tried this. Now the menus are as follows:

  1. From the Image menu select Color Adjustments...
  2. From the panel, double click on Invert
  3. At the top of the panel is a drop down menu. Select Other.
  4. Double click on Mask to Alpha.
  5. Go back to the Color Adjustments panel to Invert the image back to black.
7
6/14/2018 5:30:00 AM

Using raster software (Photoshop, Pixelmator, The GIMP):

The image you are showing appears to be aliased, meaning that the pixels are either black or white and few (if any) gray pixels near the edges. If that's the case, the magic wand tool set to a very low threshold should be the easiest way to go about it.

Alternatively, Takkat's suggestion of using alpha channels is good (though it's a bit confusing in Pixelmator, I have to google it every single time I want to use alpha channels in Pixelmator).

Using vector software such as Illustrator or Inkscape

If your image is of a decent resolution, an alternative is to import it into a vector application and then use the auto-trace tool to convert it into a vector image--at which point the white would be non-existant.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
^