177

I want to replace the whiteness in pixels with transparency in the same way as described in this question - i.e. for lighter pixels to be made proportionally as transparent. All solutions found via google are based on magic wand or other methods that do not work for my needs. I'm sure there used to be a way to do this in earlier version of Photoshop (a simple functions to replace a colour with transparency), but I can't seem to do it in CS6. Replace Colour has no alpha options..

11
  • 4
    Why is the question you linked to insufficient? Have you tried Select > Color Range... to create a selection then mask or remove it?
    – Scott
    Oct 3, 2013 at 14:55
  • Because I suspect the Imagemagick solution in that link won't work in CS6 ;) The select method is surely also flawed because it constrains the selection. I want the lightness value in all pixels to convert to alpha value.
    – geotheory
    Oct 3, 2013 at 15:01
  • 1
    Made a webapp a while ago to do this: hvitur.dmitry.lol
    – Dmiters
    May 10, 2017 at 16:45
  • 2
    The free graphics editor Gimp also has a nice little "Color to Alpha" filter, which works well: docs.gimp.org/en/plug-in-colortoalpha.html Jun 3, 2017 at 10:05
  • 2
    @AndréHauptfleisch thanks a million! The Gimp "Color to Alpha" filter is AMAZING. I can't believe Adobe Photoshop doesn't have an equivalent. In my opinion a full answer should be given about how to use Gimp for this instead of Photoshop, because people are seriously missing out if they don't know about it. It is such a shame that this question is locked, so we can't add the real answer!!!
    – Mark Ch
    Oct 14, 2018 at 9:50

3 Answers 3

190

One method is to use the original image/layer as its own layer mask. You'd create a duplicate of the layer, desaturate and invert it, pasting the greyscale result into the original layers layermask.


Update: Here are some step by step instructions:

Start with your flattened image:

enter image description here

Add a Saturation/Hue adjustment layer and turn down the Saturation until the image has no color. If you don't have any gradient in your original image, you can just use a Threshold adjustment layer instead, which will result in 100% black or 100% white results.

(Technically you could skip step, as we'll be pasting it into a layer mask which will convert it to greyscale anyway. This will give you a good visual reference though to tweak the black/white balance)

enter image description here

Add an Invert adjustment layer, then a Curves adjustment layer. Tweak the Curves until everything you'd like to be solid/opaque is white, and everything you want fully transparent is black. You may have to tweak this a few times to get the amounts right.

enter image description here

Now CTRL+A to select the entire image and CTRL+SHIFT+C to copy the combined greyscale result. Create a layer mask on your original layer. Now ALT+Click in the layer mask icon to enter direct edit mode. Now paste the black and white image you just copied into there.

enter image description here

Now click back on your original layer to exit the layer mask direct edit and hide all your adjustment layers.

There you have it! If you find your finished result isn't fully opaque (solid) in the areas you like it, you can either tweak the curves and do it again (you'll need more white in those areas), or just duplicate the result/layer a few times until it becomes less transparent (example below).

enter image description here

This also works on black backgrounds, just don't use the Invert layer filter.

9
  • 1
    what if the background I'd want to be transparent is blue/grey? Nov 1, 2014 at 2:15
  • 1
    @Pineapple Under the Sea - It can work on colored backgrounds, but you would need enough tonal contrast. For that reason it usually doesn't work well on mid-tone colored backgrounds. Try a hue/saturation filter on the original image and remove the color, if the background looks similar to the part you want to keep (similar tone in greyscale), this method probably won't work well for you. In that case you'll have to paint or trace it out. This method works by exaggerating the tonal difference of the background vs part you want to keep until it is black vs white...
    – John
    Nov 1, 2014 at 12:55
  • 1
    @MicroMachine That is because those parts were not 100% white in your mask. Either use an adjustment layer to tweak the mask, or duplicate your result layer a few times to make the result less transparent, as I did in the example image above.
    – John
    Oct 18, 2017 at 15:26
  • 1
    That's a beautiful logo.
    – bubbleking
    Aug 23, 2019 at 20:28
  • 1
    This is so cool it is a bit sad I cannot upvote twice.
    – xpy
    Jun 30, 2020 at 7:15
131

You can use blending to add transparency:

  1. Right click the layer you want to add transparency to, pick the "Blending Options..." (If unable to pick 'Blending options' ensure that the layer is unlocked)
  2. Locate the scale under the "This layer:" that is under the "Blend if" box
  3. Press and hold the alt key while dragging on the white knob, the further you drag it to the left the more transparency is added based on the whiteness of the layer. See the image of how the two white knobs are separated.

"Blend if" box

If you also want the layers below it to have the same transparency as the current layer you can set the "Knockout" under "Advanced Blending" to "Deep". Layers below that are locked will not be affected by this.

I have only tested this in CS5.5, but I think it should be very similar in CS6.

7
  • 7
    all in one sceenshot i.imgur.com/XMgUnwX.png
    – JinSnow
    Jul 13, 2015 at 12:40
  • 11
    This has blown my mind. I've been using Photoshop for maybe 14 years or more years and I didn't know about this feature. I mean, it probably wasn't introduced in the earlier versions, but still, wow. I have seen those sliders but never knew what they did! Cheers Vegard, you wonderful beast. Jul 16, 2015 at 9:12
  • I'm not sure how to do John's answer on my crusty old photoshop 7, so this helped a lot and was way easier! Had to copy the layer, delete the old layer, and repeat the procedure to get rid of all the white.
    – B T
    Sep 26, 2015 at 22:56
  • Thank you so much for this - this had to be this easy :) Oct 5, 2017 at 18:01
  • 2
    Found this again, and I'd already upvoted it. Wish I could upvote it again. So helpful!
    – Ryan
    Aug 6, 2019 at 3:16
4

The free "un-multiply" photoshop plugin here does a free, quick, excellent job at this task, though only for blackness in pixels. However, if you invert the image first, run it, then invert the image again, it accomplishes the same thing:

http://www.ayatoweb.com/download/down04.html

That page is in Japanese (foreign to me ;), though it's easy to find the download links. I believe it comes with an older version of an MSVC dll which must be put in the application root directory of photoshop.

Note also the "unmultiply" filter for filter forge and other means of doing this task, linked from that same page.

Again, while this filter accomplishes this for blackness in pixels, if you invert the image first, then run the filter, then invert the image again, it will accomplish this with whiteness--temporarily inverted whiteness.

2
  • Unmultiply is fine for black backgrounds. For white backgrounds, we'd need an Unscreen. I cannot find a free version, though; so far I've only found creative.adobe.com/addons/products/1328 Mar 22, 2016 at 16:19
  • 1
    @StevenVachon please re-read my answer which I've edited for clarity. In a nutshell: you can accomplish an "unscreen" by inverting an image, running the filter, then inverting the image again. I'd personally rather accomplish with a free plugin what it can do in one step than what Photoshop without a plugin can do in several steps. Mar 25, 2016 at 20:48

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