I have an image created by a graphic designer and it has about 20 layers in it. How can I make an area transparent all the way through so that wen I export the image to PNG it will have a transparent "hole" in it?

4 Answers 4


You could apply an identical layer mask to each of the layers. Make one layer mask, copy it, paste it, and anchor it into another layer mask, 20 times.

You could hide the background layer (if there is one), and merge the visible layers to one layer, then add one layer mask - since it's being output to a png anyway, which has no support for layers.

You could hide the background layer (if there is one), then create one new layer from visible, and add one layer mask to it. Then hide all the other layers.


The Quick And Dirty Way

  • Right click any layer in the layers dialog.
  • Click Flatten Image (the last option in the right click menu).
  • Optional:
    • Right click the resulting layer.
    • Click Add Alpha Channel.
  • Use the eraser or selection tool to create the hole.
  • Export.
  • Why the downvote? A small comment with a justification would be nice.
    – Socowi
    Apr 24, 2017 at 12:26
  • Your approach kills the layers (even if only temporary), and people think this is not what the question is about? May 4, 2017 at 13:47
  • 2
    Maybe... I assumed that wouldn't be a problem, since the OP only seemed to care about the exported PNG (quote: »wen I export the image to PNG«).
    – Socowi
    May 4, 2017 at 14:18

Use the clear-layers script.

clear-layers deletes the selection in several layers. Edit/Clear layers/All affects all layers, while Edit/Clear layers/Visible only affects visible layers.

You can also do it directly in the python-fu console (warning, this assumes that there is only one image loaded in Gimp):

for layer in image.layers:pdb.gimp_edit_clear(layer)

(Strike enter twice after the second line.)


on gimp 2.10.30
create a top transparent layer and set it to "erase mode".
now, draw on the erase layer with any color.
and make it sure all layers below it have the alpha channel.
obs.: you can set the opacity of the erase layer too.
enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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