■最上位のレイヤを一括してpng形式にエクスポートするプラグイン

from gimpfu import *
import os

def export_to_png(image,dirname):
    for target in image.layers:
        path = "%s.png" % os.path.join(dirname,target.name)
        pdb.file_png_save_defaults(image,target,path,path)

register(
    "export_to_png", 
    "", 
    "", 
    "", 
    "", 
    "",
    "export_to_png", 
    "RGB*",
    [
        (PF_IMAGE, "image", "Input image", None),
        (PF_DIRNAME, "dirname",  "Output directory", "."),
    ],
    [],
    export_to_png,
    menu = "<Image>/Filters")

main()