How Discard Invisible Layers Works in GIMP
This article provides a clear overview of the "Discard invisible layers" option within GIMP's Merge Visible Layers dialog. You will learn the exact function of this setting, how it affects your project's layer stack, and the scenarios in which you should enable or disable it during your image editing workflow.
When you merge visible layers in GIMP by navigating to Image
> Merge Visible Layers (or pressing Ctrl + M),
a dialog box opens with configuration settings for the merge. Among
these settings is the Discard invisible layers
checkbox.
The primary function of the Discard invisible layers option is to automatically delete any layer whose visibility (the eye icon in the Layers panel) is turned off at the time of the merge.
Enabling the Option (Checked)
When this box is checked, GIMP performs two actions simultaneously:
- It combines all currently visible layers into a single, unified layer according to your chosen merge criteria.
- It permanently removes all hidden layers from the Layers panel.
This is useful when you are finalizing an image and want to purge
temporary assets, rough sketches, or unused reference layers to clean up
the project and reduce the overall .xcf file size.
Disabling the Option (Unchecked)
When this box is left unchecked (the default state):
- GIMP merges all visible layers into one layer.
- Any hidden layers remain completely intact in the layer stack, remaining invisible and untouched.
This is the safer choice if your hidden layers contain backup copies, alternative edits, or elements you plan to reveal and work with later.
If you accidentally enable this option and discard layers you
intended to keep, you can immediately restore them by using the Undo
command (Ctrl + Z).