54

Is there a "bucket fill to transparent" tool in gimp? That is: something which is exactly the same as bucket fill(Shift+B) but which fill to 100% transparent, instead of to a color.

And also: Is there a pencil tool, which will allow me to draw with 100% transparent, instead of with a color?

Edit: I found the solution to 'fill with transparent': Select the 'fuzzy select tool', click the color and then Edit->Cut

I really wish Gimp would support drawing with transparent as a color.

3 Answers 3

19

To fill in the transparency with another color, create another layer under the one you want to fill in the transparency to and use the bucket tool to color that layer whatever you want (or with a pencil for multiple colors.

Another method of doing this is to change the threshold on the bucket all the way to 0 if you only want to fill in 100% transparency.

Also, a pencil that draws transparency is called an eraser ;)

7
  • 2
    But I can't draw with the eraser like i can with a pencil. The drawing operations are different. How would I setup the eraser to make a single pixel transparent, without affecting any other pixels?
    – MTilsted
    Aug 20, 2013 at 14:37
  • 3
    I don't understand the layer solution. My image only got one layer. So I can create a new layer and paint it black, but how does that help with anything? I can't create a layer with just the part of the image i want to erase.
    – MTilsted
    Aug 20, 2013 at 14:45
  • Change the brush and size for the eraser within the eraser settings so that it would be 1-pixel, like how you want it.
    – slippery
    Aug 21, 2013 at 1:00
  • 2
    To make Eraser behave like Pencil, turn off antialiasing in tool options.
    – Grue
    Aug 21, 2013 at 14:08
  • 6
    Isn't this answer the opposite of what the OP asked? The OP want to "erase" a selection to transparent, not fill a transparent region with a color.
    – Ralph
    Mar 18, 2017 at 12:57
40

Bucket Fill Transparency with GIMP

Note: This tutorial is also available in PDF.

_La trahison des images_ by fellow countryman René Magritte; partly vandalised for the purpose of this tutorial.

Add an alpha channel

Some image types lack a transparency channel; JPG for example. If this is the case, add an alpha transparency channel. This is done by selecting Layer → Tranparency → Add Alpha Channel.

Bucket fill with colour [optional]

The next step is optional and consist in filling the area that should become transparent with a plain colour. Select the bucket fill tool or hit [Shift]+[B]. Within the Bucket Fill toolbox options, select Fill transparent areas only when necessary. Do select BG colour fill and Sample merged and run a few tries while adjusting Threshold for best results. In between, hit [Ctrl]+[Z] to undo.

Some colour mixing will be inevitable and even desired. (In this respect, Adobe Photoshop is no different.) Hence, choose a colour which is compatible with the background on which the resulting picture will eventually be used. Click on the background colour rectangle in the upper half of the Tool Options toolbox window to change the background colour. Here, I used f3f3e9 as a background colour for plain colour filling. However, one can also use the eyedropper tool to pick a colour from anywhere on the desktop.

<code>Bucket Fill</code>:  Select <code>Fill transparent areas</code> only when necessary. Do select <code>BG colour fill</code> and <code>Sample merged</code> and run a few tries while adjusting <code>Threshold</code> for best results. In between, hit <code>[Ctrl]+[Z]</code> to undo.

<code>Bucket Fill</code> applied. Choose a fill colour which is compatible with the background on which the resulting picture will eventually be used. This is because some colour mixing is inevitable and even desired. Here, I used <code>f3f3e9</code> for plain colour filling.

Select by colour

The right thing to do now is Select → By Colour. It might be tempting to perform Colour to Transparency, however this would also change semi-transparent areas within the desired image area. This time around, do select Fill transparent areas as well as Sample merged. For this particular example I chose not to apply Antialiasing nor Feather edges. Nonetheless, do experiment with these settings and choose what looks best. Again, run a few tries while adjusting Threshold for best results. In between, hit [Ctrl]+[Z] to undo.

<code>Select by Colour</code>:  This time around, do select <code>Fill transparent areas</code> as well as <code>Sample merged</code>. Again, run a few tries while adjusting <code>Threshold</code> and experiment with <code>Antialiasing</code> and <code>Feather edges</code> for best results. In between, hit\ <code>[Ctrl]+[Z]</code> to undo.

<code>Select → By Colour</code> applied

Subtract from the selection

At times, it proves difficult to get the colour selection exactly right. Some of the desired image area might be selected as well because the colour matched. In this case, and barely visible, nine desired pixels in the middle of the pipe were also selected for deletion. When this happens, use [Ctrl]+Drag with a Select tool of your choice to select a subtractive selection area.

Use <code>[Ctrl]+Drag</code> with a <code>Select</code> tool of your choice to select a subtractive selection area.

The desired transparency area is now selected.

Delete

Once the desired transparency area is selected, simply hit [Delete].

Once the desired transparency area is selected, simply hit <code>[Delete]</code>.

Final result

Finally, export the transparent image with File → Export As... to a file format which supports transparency. That would be preferably PNG, but GIF would work as well.

The final result

5

To make it it a lot easier, you could just right click to get to the "select" option. After that, select the border of the region to become transparent, and then click "delete" on your keyboard.

3
  • 1
    How is this better than other answers?
    – Toto
    Apr 8, 2018 at 19:08
  • This is a lot better, since is allows to make multiple colors transparent and also applies to a feathered selections.
    – John
    Nov 6, 2020 at 14:26
  • On a Mac, it's [fn]+[delete] Nov 11, 2023 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .