I have an image where the background is white and there are various important components that are also white. I want to just change the background to alpha, but "Colors to Alpha" - by default - changes all the white to alpha.

Please help and thank you!


If the image is in a single layer, select the areas you want to go transparent with the "Magic Wand" (Fuzzy Select) tool instead.

Them just Edit->Cut to get rid of the selected parts. (Make sure your background layer has an alpha channel Layer->Transparency->Add Alpha Channel).

If your background is in a different layer, then just delete/hide that layer.


If you have an active selection, Color to Alpha will only affect the selected parts of the image. Thus, you just need to select the background (e.g. with the Magic Wand tool) and then apply Color to Alpha, leaving the un-selected areas untouched:

OriginalSelectionColor to AlphaResult
(Original image by Creative Tools, used under the CC-By-SA 2.0 license.)

See Making the background of an image transparent in Gimp for a more detailed step-by-step explanation, from which the sample images above are taken.

(Of course, if you don't wish to preserve any shadows or reflections in the background, then you can simply Cut it away instead, as jsbueno suggests in his answer.)

There are several variations on this technique that will let you fine-tune the selection afterwards. One is to make two copies of the layer you're editing, convert the selection to a layer mask on the upper copy, and apply Color to Alpha to the (entire) lower copy. This way, you can edit the mask to fine-tune the border between the opaque and semitransparent parts of the image.

Alternatively, you can create a pure white layer (with an alpha channel) under the layer you're editing, cut out the selection from this white layer, and again apply Color to Alpha to the entire image layer. Again, by painting and/or erasing the white layer, you can adjust which parts of the image should be opaque. One potential advantage of this method, if you intend to place the resulting shape over a specific background, is that you can also paint other colors onto the lower layer to help it blend with the new background.


Three ways:

  1. Just use a selection. If there are hard edges make the selection cover the edge pixels (because that's where C2A is the most important.

  2. Use a paint tool (Brush, usually) in Color Erase mode and paint over the areas that should become transparent using the color that should be removed.

  3. Since Gimp 2.10: add a transparent layer, set it to Color Erase mode and paint on it (with the paint tool in Normal mode). However, like all layer modes, this affects the whole layer stack by default (you are color-erasing all the layers below the Color erase one), so in most cases you want to put the target layer and its Color erase layer in a separate layer group.


For Windows.. In the task bar go to Windows > Dockable Dialogs > Tool Options after that - click the magic want tool. You should see inside the Tool Options change to Fuzzy Select. There are three Modes there, I usually use "Add to the current selection" out of these however, the 3rd one is "Subtract from the current selection" I use it just as much.

Hopefully that's what you're asking for and it's probably harder that way but I'm a beginner too.


I never got very good results with the selection tools, but I found a way that works better for me in a comment in the Gimp issue tracker:

FWIW, the "color erase" layer mode does the same thing as "color to alpha" (with 0/1 threshold parameters). One way to get a linear "color to alpha" is to merge down a layer filled with the background color, using "color erase" layer mode and linear RGB blend space, into the input layer. Not that I'm saying that this is the sort of solution we're looking for :)

So basically you simply create a new layer filled with the color you want to remove, edit the layer properties and set it to Color erase mode. This will remove the color from the layer below, you can then merge down.

This produces the desired effect for me, that only the uniform colored areas are removed, but other areas are left alone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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