GNOME Bugzilla – Bug 337557
add a toggle to merge_visible_layers to discard non-visible layers
Last modified: 2006-04-07 08:01:12 UTC
In my quest to avoid the export dialog, I wrote a python script that offers the same functionality that merge_visible_layers does but also removes the non-visible layers. The script only uses one pdb call, which I thought was really cool and perhaps meant that it would be easy to add a toggle to the existing merge_visible_layers dialog that would allow discarding the non-visible layers. The one pdb call makes the script really work as a one step before saving as a transparent png. Here is the relevant portion of the script: for layer in image.layers: if not layer.visible: image.remove_layer(layer) final_layer = image.merge_visible_layers(merge_type) if merge_type == EXPAND_AS_NECESSARY: pdb.gimp_image_resize_to_layers(image) I will attach the script in case anyone wants to try it.
Created attachment 62885 [details] python script to merge-visible-layers and discard not visible layers
2006-04-07 Sven Neumann <sven@gimp.org> * app/core/gimpimage-merge.[ch] (gimp_image_merge_visible_layers): allow to discard invisible layers as suggested in bug #337557. * app/actions/image-commands.c * app/dialogs/image-merge-layers-dialog.[ch]: added a check button to the Merge Visible Layers dialog to control the new feature. * app/file/file-open.c * tools/pdbgen/pdb/image.pdb: pass FALSE for the new parameter. * app/pdb/image_cmds.c: regenerated.