Gimp-Forum.net
exporting all the layers - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: exporting all the layers (/Thread-exporting-all-the-layers)



exporting all the layers - aka - 12-30-2021

Hi,

I please need a script which exports all the layers, one by one, in png format.

The result could be something like :

1_nameLayer1.png
2_nameLayer2.png
3_nameLayer3.png
..

Where 1, 2, 3,.. are respectively the positions (levels) of the layers nameLayer1, nameLayer2, nameLayer3,.. of the gimp image file ; I need to keep the transparency.

It is unfortunately impossible for me to install the gimp pyton module, so, does please this scrpit exist in gimp by an other way ?

Thanks Smile


RE: exporting all the layers - rich2005 - 12-30-2021

Ah... no python Wink

However, try the attached script-fu, looks like this 

[attachment=7308]


RE: exporting all the layers - aka - 12-31-2021

Thanks a lot !!


RE: exporting all the layers - aka - 05-09-2022

Hi,

Your script-fu is so usefull for me  Smile ; and is it please possible to export the transparency of the layers too ?

Thanks !


RE: exporting all the layers - Ofnuts - 05-09-2022

(05-09-2022, 07:03 AM)aka Wrote: Hi,

Your script-fu is so usefull for me  Smile ; and is it please possible to export the transparency of the layers too ?

Thanks !

The build in opacity or the opacity set by the slider? The later is really only the opacity of the layer when composited with the others and is not really part of he layer data.


RE: exporting all the layers - aka - 05-09-2022

I was speaking about the opacity of the layer ; but perhaps is it simply possible to change the opacity of a selected part of a layer ?


RE: exporting all the layers - rich2005 - 05-09-2022

(05-09-2022, 08:02 AM)aka Wrote: I was speaking about the opacity of the layer ; but perhaps is it simply possible to change the opacity of a selected part of a layer ?

If you export layers as png (for transparency)  with each layer having variable transparency, even if that is a layer mask, you get an image with that transparency.

[attachment=7892]


RE: exporting all the layers - stepha_net - 02-11-2023

(12-30-2021, 07:37 PM)rich2005 Wrote: Ah... no python Wink

However, try the attached script-fu, looks like this 

Thank you, that is marvelous! Juste one thing maybe it's me: the exported files don't take into account that I cropped my image before exporting, which was the point of my operation (cropping unused part of the image). Is that the script or a setting I need to adjust in Gimp?


RE: exporting all the layers - rich2005 - 02-11-2023

(02-11-2023, 05:11 AM)stepha_net Wrote: ...snip...the exported files don't take into account that I cropped my image before exporting, which was the point of my operation (cropping unused part of the image). Is that the script or a setting I need to adjust in Gimp?

Probably the crop tool settings.  By default (used to be, maybe still is) the Delete Cropped Pixels toggle is off
That just hides the cropped area, in case you need to recover it. You can actually see this if you enable View -> Show All.  The crop only come into effect when you Export in Gimp flattening all your layers.

Repeat the crop of the layers with Delete Cropped Pixels toggle on

[attachment=9361]


RE: exporting all the layers - Ofnuts - 02-11-2023

(02-11-2023, 05:11 AM)stepha_net Wrote:
(12-30-2021, 07:37 PM)rich2005 Wrote: Ah... no python Wink

However, try the attached script-fu, looks like this 

Thank you, that is marvelous! Juste one thing maybe it's me: the exported files don't take into account that I cropped my image before exporting, which was the point of my operation (cropping unused part of the image). Is that the script or a setting I need to adjust in Gimp?

The individual layer export operations export the full layers. If you crop your image, use the Delete cropped pixels option of the Crop tool.