Batch save all opened files in GIMP .xcf

1.9k Views Asked by At

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?

1

There are 1 best solutions below

1
On BEST ANSWER

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).