1

I have a series of manually edited images and layers in GIMP, each set is in a single tab. All want to save all of them into different .xcf's.

I am aware of some scripts to export them as images (like this one), but I want to save them as .xcf, not export the images. Moreover, I would like to have them in a single folder, so that I can load them all in the future.

Is there any script to do this?

pbruno
  • 147
  • 10

1 Answers1

0

You can save all projects using this code bellow

dirname = “Path of file”
path = “File name”

imgs = gimp.image_list();
    num = 0;

for img in imgs:
    for layer in img.layers:
        fullpath = os.path.join(path, dirname+str(num)+'.xcf');
        pdb.gimp_xcf_save(0, img, layer, fullpath, fullpath);
        num += 1;

Or, if you can install complete plugin in https://github.com/Tushn/GIMP-Plugins/blob/master/src/saveproject.py

Instructions for install in https://github.com/Tushn/GIMP-Plugins

If you want open all file, so it’s enough that you mark all xcf in directory and enter in GIMP (click right buttom mouse, case your GIMP is not default file).

Tushin
  • 36
  • 4
  • 2
    You don't need to loop over the layers. I think the layer parm is used only for symmetry with other `file_{type}_save` operations towards "flat" formatz, that actually save only the mentioned layer but in this call it is ignored. – xenoid Sep 19 '18 at 20:46