6

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
    I'm not all that familiar with GIMP so I can only offer a really lame workflow, but perhaps you can duplicate the layer over and over until there is no transparency? – JohnB Nov 19 '14 at 1:37
5

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.

6

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

3

For my answer I need a little preamble.

In GIMP as well in other editors the images can have a specific channel named Alpha channel, so named from a process called alpha compositing, used to create the appearance of partial or full transparency. You can find here a simple diagram which illustrates this concept.

Some image formats (e.g. PNG) are able to store the alpha channel information and some applications (e.g. the browsers) are able to use this information while representing the image.

On the other hand, you can use on an image (whether with alpha channel or not) brushes with opacity (see here), which create the effect of a color with transparency while drawing.

If the layer is without alpha channel, the brush's color merge with the background color (or anyhow with the colors of the pixels).

The eraser removes areas from the layer replacing them with the background color or - if the alpha channel is on - with transparency (see here).

Finally, when you remove the alpha channel, GIMP replaces the transparency with the background color (in your example the background color was black).

--

Coming to your question, if you want transparent images with full colors, you can simply use brushes with a 100% of opacity (and, if the case, a hardness of 100).

  • 1
    What's odd about my question? – Tomáš Zato Nov 19 '14 at 15:02
  • More than odd is unclear (I've corrected my answer). What you are proposing to obtain? You start from a blue cross done on a layer with alpha channel and white background; then you use the eraser tool to remove the background and to make some transparency on the cross; then you remove the alpha channel; and later you come out with the desired image. If you need to "render the original color as full color" in an image, you have to use a brush with the "full color". – Paolo Gibellini Nov 19 '14 at 15:39
  • Ah, now I see what's unclear. The background wasn't hidden by eraser - it was other layer and to picture transparency, I decided to hide it in the other images. But otherwise I think my question was clear enough - maybe the thing I want is just something most people wouldn't use. But in some cases it's just better to get full color than blend the color with background. – Tomáš Zato Nov 19 '14 at 17:12
  • There are many ways to achieve the same result ;-) – Paolo Gibellini Nov 19 '14 at 21:06
  • I don't think this question is unclear at all. – jsbueno Nov 20 '14 at 16:08
1

Finally found the answer to this:

Layer > Transparency > Semi-Flatten (With an appropriate background colour, white worked for me).

  • And what is the difference to the other answers? – Mensch Oct 6 '15 at 17:05
1

Just enable Anti erase (Alt) in the Eraser tool options, set opacity to 100%, and use it.

It does what it name says, the opposite of the usual erase operation, removes transparency.

How it works: transparency is stored in another channel, just as three base colors have each their own channel. This fourth channel is named alpha channel, you can see it in the Channels dialog. The Eraser tool works like a usual brush, but instead of adding to all channels (the Normal mode of a brush tool), it alters only the alpha channel. In its usual mode it decreases alpha (adds transparency), and in the inverted (anti erase) mode it increases alpha (removes transparency). How much transparency will be added or removed with each stroke is controlled by the opacity parameter.

  • can you explain how that works? we're searching for long answers with a bit more context. – Luciano Jan 17 '17 at 9:22
  • @Luciano, updated – user Jan 17 '17 at 17:04

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.