Assume I have an icon on a pure white background in a PNG image. The icon is a solid color, with edges anti-aliased, so they are blended with white. I need to delete the white background so that the non-content is transparent. How can I get the anti-aliased edges to blend from the fill color to transparent, instead of white?
There is a similar question on the site, but this is actually a different case: dealing with solid colors, and anti-aliasing of just the edges, not reblending entire portions of the image. I don’t think the answer from the other question applies. I can’t reasonably apply a gradient to just the one-pixel edge of an icon. There aren’t enough pixels. Also, this method doesn’t scale well when the icon edges are irregular (like a Twitter bird).
Perhaps the question is whether it’s possible to de-antialias an icon, knowing the foreground and background colors exactly, and to re-antialias it on a transparent background.
Answer
I usually create a new alpha channel based on the selection of the color.
-
Assuming you are starting with one flattened layer with a color on top of a white matte background. This works best if your color is dark/black. Play with some adjustments to get it as dark as possible.
-
Open your
Channels
palette andctrl+click
on the RGB channel to load it’s selection, thenctrl+shift+i
to inverse the selection. -
Press the “Create a New Channel” while your selection is still active. This will create an alpha channel for you and focus on that.
-
Go back to your
Layers
palette and the alpha selection should be active. Create a new layer and select theFill
tool of the color of your choice and fill in your new, matte-free single-color icon.
Attribution
Source : Link , Question Author : acjay , Answer Author : rgthree