0

Using GIMP 2, I have an image of a grey chair on a white background, as below:

enter image description here

I now want to set the background to transparent. Therefore, I decided to use GIMP's "Color To Alpha" tool. So, I told it to set all pixels which are white (255, 255, 255) to transparent, as below:

enter image description here

This did set all white pixels to transparent. However, it also set the grey pixels on the chair to be partially transparent, as below:

enter image description here

So when I export this image and place it in front of a background, there is no white box around the chair -- but the background partially shows through the chair.

What am I doing wrong?

Karnivaurus
  • 22,823
  • 57
  • 147
  • 247

2 Answers2

3

First, this question is offtopic here, and should be on https://graphicdesign.stackexchange.com .

Second, it is trivial enough just to answer: the color to alpha plug-in is not there to turn a single color, as seem on the image, to transparency: it is a sophisticated plug-in that will remove one color of your image in a way that, if you lace the new image over a background of the same color the color you removed, you get the original image back.

Thus, in your case, it removed the "whiteness" of your chair, transforming all pixels to different opaque shades of black - so that when placed over white, you get the original image.

To simply remove the white, you have to cick on the Select By Color tool (by default th 5th icon on the toolbox), click on the white background to have it selected, and then just edit->cut. (It won't work if your image layer does not have transparency to start with - if that is the case, prior to edit->cut do Layer->Transparency->Add Alpha Channel).

If you get aliased borders, then, after edit>cut, but prior to dismissing your selection, you can do Select->Border... by 1 or 2px, and then use the color to alpha filter with White on this selection.

For more information on Color to Alpha, I have this other answer its use and comparison with edit-cut here: https://graphicdesign.stackexchange.com/questions/28058/gimp-color-to-alpha-is-not-selectable/28097#28097

Community
  • 1
  • 1
jsbueno
  • 99,910
  • 10
  • 151
  • 209
-1

Just use a selection to restrict the action of Color to alpha where it matters: backgroundand edge pixels:

  • Select background with fuzzy select
  • Select>Grow by one pixel so that the selection ofverlaps the edge pixels
  • Color>Color to alpha
xenoid
  • 8,396
  • 3
  • 23
  • 49