Export Layers as PNG

File->Export Layers->

Prompts for a folder to save PNG files. Pretty straightforward.

Tested in 2.6.1 on linux and 2.6.6 on XP.

AttachmentSize
export_layers-0.2.py1.17 KB
0
Average: 5 (1 vote)

Comments

works as advertised

This works perfectly in GIMP 2.6.7 on Ubuntu 9.10. Just drag to your plug-ins folder (probably ~/.gimp-2.6/plug-ins/) and then at the command line run chmod +x ~/.gimp-2.6/plug-ins/*.py and restart GIMP.

Not working on 2.6.7

I've tried using this in Gimp 2.6.7. and no options come up. There's not even a menu entry

i guess you use windows

..and that you do not have the gimp python module installed

and install it may be a bit complex see

http://www.registry.gimp.org/node/3916

if you want to save layers

if you want to save layers with alpha channel you only need to comment tmp.flatten(). The code looks like: for layer in dupe.layers: layer.visible = 1 name = layer.name + ".png" fullpath = os.path.join(path, name); tmp = dupe.duplicate() #tmp.flatten() pdb.file_png_save(tmp, tmp.layers[0], fullpath, name, 0, 9, 1, 1, 1, 1, 1) dupe.remove_layer(layer) Thanks for the script

nice

I should add that as an option perhaps - to flatten or not.

in windows may be a problem

in windows may be a problem mostly how to chose/wrote the path As use / instead then \ ..or viceversa and blank spaces in the path names, quite commune in Windows( As example C/Documents and Settings/ ) would be supported ?

no problem

Nah - I just tested in XP and it's OK. Both windows and linux have a funkiness though: you have to show the location bar in the file chooser. When you are in the directory to export to, enter a period (.) in the location bar and *then* click open or press enter. But \ or / does not matter, nor do spaces in the path.

fixed the quirk

the script now prompts for a dir, so you don't have to put the "." in there... I used PF_FILE initially, but PF_DIRNAME is correct.

test, test, testing 1, 2, 3...

spam filter working yet? :)
Syndicate content