11-29-2022, 06:27 PM
To remove a layer use (gimp-image-remove-layer image layer) (this releases the memory).
IMHO you script would be more robust if you start by setting a variable to the layer returned by gimp-layer-new-from-drawable and then use this variable instead of calling gimp-image-get-layer-by-name, because you script will fail if there is already a "background copy". Your background layer is also the last of the layers is the list, so you don't need its name...
IMHO you script would be more robust if you start by setting a variable to the layer returned by gimp-layer-new-from-drawable and then use this variable instead of calling gimp-image-get-layer-by-name, because you script will fail if there is already a "background copy". Your background layer is also the last of the layers is the list, so you don't need its name...