Turning pixel brightness into transparency in single-hue image


I'm looking for a way to take single-hue images and turn their brightness into opacity in Photoshop.

At the simplest, say you have a flat green circle on a white background (as an already saved file). I want to turn the aliased edges where the pixels are a lighter green into pixels of the same value as the center of the circle, but more transparent.

Theoretically, I could then put this image on any color background and it would look aliased. No little borders that are so indicative of the image originally having a different background color.

This seems like a super-basic thing to do, and I'm maybe I'm just not describing it with the right words, but I can't find it ANYWHERE.


6/13/2014 9:40:00 PM

The short answer is you can't. It doesn't work that way, because the anti-aliasing pixels are already a mix of your flat color and white. Even a fuzzy selection tool like Select > Color Range will create a partial selection of the already-modified colors.

You have two basic ways to accomplish the end product you're going for. Either works for any solid color shape against any kind of background.

  1. Create an anti-aliased selection that excludes the original anti-aliasing (There are many ways to do this. This is only one of them.):

    • Eyedropper your color so it's the active foreground color.

    • Select > Color Range and click to select all of your colored shape.

    • Use Refine Edge to reduce the selection to within the area that is your solid color.

    • Adjust the Smooth and Radius sliders to provide the amount of anti-aliasing you need.

    • Click the new layer mask icon at the bottom of the Layers Panel to mask off the rest of the layer.

  2. If you really want to retain the original size, including the anti-aliasing pixels, you have to first make all the non-white pixels full color then restore anti-aliasing:

    • Use Image > Calculations to multiply the highest-contrast channel against itself to create a new channel.

    • Use a Levels adjustment on that channel to turn all the grey pixels black. (Drag the left, blacks, slider all the way to the right.)

    • Invert the channel.

    • Ctl/Cmd-click the channel thumbnail to load as a selection.

    • Revert to full RGB or CMYK mode, create a new layer, and fill the selection with your flat color and turn off the original layer.

    • Use Filter > Blur > Gaussian Blur to apply a slight (1 to 1.5 pixel) blur.

6/14/2014 7:23:00 AM