Advertisement


Forget alpha instead of blending it in Gimp


Question

It's now second time I need this so I'm posting it as a question:

When a layer has alpha channel, some pixels may be transparent. I want to totally forget about the transparency. That means, render the original color as full color.

You can "remove alpha channel" in GIMP, but it doesn't do what I actually need. Look at this blue cross I made:

blue cross

Now I've messed up with it using eraser:

blue cross damaged with eraser

If I remove alpha channel to get the original full color, as in the first image, this is what I get:

blue cross alpha removed

But no, I just want back the full blue color. And ideally, I'd like to apply this only on selection, like this one:

blue cross original

1
6
11/19/2014 5:22:00 PM

Accepted Answer

With the eraser tool we will replace pixel color information with alpha transparency in case there was an alpha channel (or background color if no alpha layer was defined).

Removing this alpha channel will replace all alpha by the background color. This will sometimes lead to unwanted artifacts in semi-transparent areas.

To overcome this we need first to make sure there is no semi-transparency in the foreground. This is done with Layer > Transparency > Threshold Alpha... and adjusting the threshold to 0:

enter image description here

Then we can remove the alpha channel with Layer > Transparency > Remove Alpha Channel to replace all 100% transparent areas with the background color.

2018/03/28
5
3/28/2018 6:20:00 AM

While @Takkat's answer is correct and should work for you, I have a one step method which I prefer:

Use the Curves tool (Colors->Curves), select the Alpha Channel, and simply drag the curve so that it is an horizontal line at the top. All Alpha information is mapped to "1" (full opacity).

The effect may, of course, be achieved by the levels tool as well, but I am really used to the curves tool.

enter image description here

2016/04/08