49
\$\begingroup\$

I have discovered Gimp's "Color to Alpha" feature, and man is it awesome! Basically, it will extract a particular color out of a selection and convert it to transparency. This gave me the ability to make a bottle taken on a flat background a truly transparent layer with highlights and shadows intact.

Does Adobe Photoshop have anything similar? Paid or otherwise? (Here's my attempt at steps coming to around 60% quality of the Gimp plugin)

\$\endgroup\$
7
  • \$\begingroup\$ Colour Range selection works very poorly. As far as I can see, there is no was to preform this action as well as GIMP can. \$\endgroup\$
    – user5456
    Jun 3, 2011 at 19:03
  • 26
    \$\begingroup\$ +1 for asking whether a feature of GIMP is available in PS, was tired of hearing the opposite all the time :D \$\endgroup\$ Jun 4, 2011 at 3:00
  • 3
    \$\begingroup\$ While the select color range tool in Photoshop may be useful for some things, it's not at all the same thing as Gimp's color to alpha. It's much like using transfer modes such as multiply, screen, or overlay, as opposed to using the magic wand tool to select white, black, or gray. As an example: if you had a solid purple layer and used color to alpha to remove blue, you would get a half transparent, solid red layer, whereas color to alpha would not do anything because there is no solid blue in the layer. \$\endgroup\$
    – user6055
    Jul 23, 2011 at 18:30
  • 1
    \$\begingroup\$ It truly amazes me how Photoshop can still not have such a great and easy tool. I use this all the time when going "Ghetto" on grabbing fonts from places that allow you to preview fonts to purchase. It allows you to pull all of the white out of the background (after you've trimmed around the edges and inverse filled with white -- except the text are). Makes for super easy transparent images. :/ \$\endgroup\$
    – user6610
    Sep 15, 2011 at 3:28
  • \$\begingroup\$ @Stephen: Any luck figuring out a solution for this yet? Seems all the answers so far have not done what you needed. \$\endgroup\$
    – jrista
    Sep 15, 2011 at 5:28

7 Answers 7

9
\$\begingroup\$

There is a plugin for Photoshop that can do this, but it's a little ancient and only 32bit. It is, however, free and may do the trick for you.

\$\endgroup\$
7
\$\begingroup\$

I believe you can use the Select -> Color Range... tool to achieve this affect. The color range selection tool is a pretty handy feature that lets you click a color from a gray-scaled version of your image, then use a "fuzziness" slider to adjust the range. You can also preview the selection in the full image. This creates a normal photoshop mask when you choose OK.

Once you have your baseline selection, you can then further adjust the mask using all of the normal masking tools in Photoshop. This is probably the most ideal way to do what you need to do (based on your previous question, your trying to isolate a bottle?) The Color Range selection will give you an almost-ideal mask with transparency in tact...and you can further adjust that to fix areas that were selected that should not have been, or that were excluded and should have been selected. Once you have fine-tuned your mask, simply hit Delete, and watch the magic occur. Since the mask was a full alpha mask, the deletion will remove varying degrees of "opacity" based on how heavily an area matched the base color you selected initially.

Since your background is white, selecting the white color and adjusting fuzziness to appropriately "fill in" the parts of white that show through your bottles should give you a pretty effective mask in about 30 seconds flat. A little adjusting might take a couple minutes, but the end result should be better than the Gimp "Color to Alpha" plugin (at least, based on the few examples I've seen...it seems to be a bit over-zealous in its application of transparency.)

Generally speaking, a "full green" or "full blue" background might be better for this kind of thing. White is a blend of all colors, and that can make it more difficult to isolate specific objects from an "all-color" background. Thats usually why a lot of special effects sequences shot for movies are filmed against a green backgrop...its easier to filter out during post-process compositing (its a single "primary" color in the RGB model, rather than a blend of all three colors. This is called Chroma Key filtering.) It should be noted that you want to use a chroma key that is complementary to the color(s) of the object being shot. For example, if you are shooting a green bottle, it might actually be best to use a red background, as using a green background would make it very difficult to exclude a green background without losing the bottle along with it. If you have yellow, orange, red or brown bottles, a blue background may be best. The general idea, though, is to use a background that is complementary (think opposite color on the color wheel) to the foreground objects being shot.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ From what I experienced Select Color Range would make a hard selection. e.g. in Gimp's plugin, if there is a green tinted patch, and I'm removing grey, the grey factor of the green is converted to transparency. Select Color Range would likely completely non-select the green transparent tint. \$\endgroup\$
    – Stephen
    Aug 26, 2010 at 11:28
  • \$\begingroup\$ I've used this tool many times...it makes a "soft" selection, or in more specific terms, it generates a grayscale "quick mask" channel that is used to generate the mask. If you need a demonstration, I can provide one, but "Select Color Range" is basically your "Color to Alpha" feature, with the extra requirement that you hit the delete key to actually make the color "alpha". As for the "gray factor", you do have slight problems with that, due to gray containing R, G, and B levels. Use of a proper complementary chroma key eliminates that, but doing what you need is still possible with white bg. \$\endgroup\$
    – jrista
    Aug 26, 2010 at 15:26
5
\$\begingroup\$

I have not used the Color to Alpha feature in GIMP, but it looks similar to converting a channel to alpha. In the channels panel, control click (or command click if you are on a Mac) on the channel you want to convert. Then you can either create a mask from the selection or press delete.

If you want more control you can edit the mask using curves, levels, etc. Just create the mask as I mentioned above and select it in the channels panel and apply whatever adjustments you want.

The Color Range tool as suggested by jrista will also work, but I find the channels method a little easier to control.

\$\endgroup\$
2
  • \$\begingroup\$ So the issue is that a bumpy clear bottle over a red background will have some parts red (as you'd expect), some parts full white (due to reflections of lights), some parts really bright red (due to concentration of light through refraction), and some parts full black (since where there's concentration of red, there'll be lack of it), and of course everything in between. So what this means is that all red hue must be removed, an exact red match is 0% alpha, and it continues from there to full 100% alpha (white and black). \$\endgroup\$
    – Stephen
    Jun 5, 2011 at 9:55
  • \$\begingroup\$ This will not remove the red hue. It just makes it partially transparent. If you want to remove the red there are several ways to do that. One way is the hue/saturation adjustment. \$\endgroup\$
    – mcrumley
    Jun 6, 2011 at 13:40
4
\$\begingroup\$

2020 UPDATE: there is no way to do it in Adobe Photoshop. Color Range and masks can not do it. The image below explains, what Color to Alpha does.

The old image is fully opaque (transparency 100%). RGB values are between #ff0000 and #000000.

The new image has transparency between 0% and 100%. The RGB values are all #ff0000. So Color to Alpha modifies both the transparency and the RGB values.

enter image description here

\$\endgroup\$
1
2
\$\begingroup\$

Few years late, but I think what you're looking for is called Color Range Masking. Look it up or follow roughly these steps: 1. Create a mask for the layer containing that colour you want to get transparent and make sure the mask is selected. 2. Look up the Masks or Properties (since CS6) window (Window > Masks/Properties). 3. There you'll find a button called "Color range..." 4. In the new window you can sample the colour you want to mask, or even add multiple colours using the button with the sampler and the plus sign. I'd suggest setting the Selection Preview to Grayscale. Just play around with it. :)

\$\endgroup\$
0
\$\begingroup\$

In my personal experience, "Select Color Range" does a rather hard selection. You can compliment this, however, with the "Refine Edge..." tool after performing the initial selection. Choose your view as "Overlay", select "Smart Radius", and adjust the radius until the overlay covers all of the color you would like to remove. Choose to Output to Selection, click OK, then delete the selection. That should remove all of the bits that a simple "Select Color Range" leaves behind.

\$\endgroup\$
-2
\$\begingroup\$

Colour to Transparency

Photoshop

  • Open image
  • F7 to bring up layers pane
  • if layer is locked, double-click where it says Background
  • Duplicate layer
  • Delete layer with padlock
  • Now use magic wand and click on color area you wish to remove and delete

GIMP

  • open image
  • go to layer/transparency
  • add alpha channel
  • tools /selection tools/ fuzzy select / delete
  • or u /delete
\$\endgroup\$
5
  • \$\begingroup\$ See the comments up below the question, though. This doesn't do the same thing. \$\endgroup\$
    – mattdm
    Jan 30, 2013 at 19:58
  • \$\begingroup\$ hi matt those two processes do the same exactly or are you referring to the Gimp here with Colours/Color to alpha \$\endgroup\$
    – shantiq
    Jan 30, 2013 at 20:22
  • \$\begingroup\$ Yes, that's what I'm referring to, because that's what the question is about. :) \$\endgroup\$
    – mattdm
    Jan 30, 2013 at 20:24
  • \$\begingroup\$ ha but it gets you there too! the way i show here is do do it in stages if you have more than one colour you want to turn to transparent the method i show here is the closest i find on PSP; it does the same \$\endgroup\$
    – shantiq
    Jan 30, 2013 at 20:28
  • \$\begingroup\$ See the comments from user6055 up above, though, or note what Stephen says in the question itself. There's more to it than that. \$\endgroup\$
    – mattdm
    Jan 30, 2013 at 20:31

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