在 GIMP .xcf 中批量保存所有打开的文件

Batch save all opened files in GIMP .xcf

我在 GIMP 中有一系列手动编辑的图像和图层,每组都在一个选项卡中。都想全部保存到不同的.xcf的。

我知道一些脚本将它们导出为图像(如 this one),但我想将它们保存为 .xcf,而不是导出图像。此外,我想将它们放在一个文件夹中,以便将来可以加载它们。

有没有脚本可以做到这一点?

您可以使用以下代码保存所有项目

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;

或者,如果您可以在 https://github.com/Tushn/GIMP-Plugins/blob/master/src/saveproject.py

中安装完整的插件

安装说明 https://github.com/Tushn/GIMP-Plugins

如果要打开所有文件,那么在目录下标记所有xcf并进入GIMP就可以了(点击鼠标右键,如果你的GIMP不是默认文件)