You are here

Export Layers as PNG

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

File->Export Layers->as PNG

Prompts for a folder to save PNG files. Pretty straightforward. *Requires* python!

Should work with 2.4.x through 2.8.x. Will NOT work with some 2.7.x versions and the 2.8 RC1! 2.7 users should move on to current git and 2.8 RC users should upgrade to current 2.8.

Updates:
- toggle to flatten (remove transparency).
- toggle to save only visible layers
- now saves as filename + layername and special characters are removed
- toggle to remove layer offsets
- toggle to zealous crop each PNG before saving
- handle layer groups (introduced in GIMP 2.8)

NOTE: the registry added a .txt extension - you need to rename to file to just 'export_layers-0.6.py' and make executable if you're on linux.

AttachmentSize
export_layers-0.6.py.txt2.72 KB
GIMP Version: 
Code License: 

Comments

When the scripts saves the layers, I would like it to automatically append the file name to the saved pngs, cause I want to know which file they came from. I was looking at the script and it seems it would be on line 20, where it tells gimp what to name the layers. How should I change it?

Change line 20 to read:
name = img.name + layer.name + ".png"

I have a windows icon file I am working with. I open it with gimp and the various sizes come up as layers. I want to save each layer as as a separate image. When I install this script, I only get the menu option "Open as layers", so I use that to open the image. It opens the image as a multi-layered image just as it does by normally opening it. I never get a menu option to export the layers. I am using Gimp 2.6.8 on Ubuntu.

"File->Open as Layers" is built into GIMP. "File->Export Layers->as PNG" is provided by this plug-in and ends up at the very bottom of the File menu. If the menu item is not there, make sure the plug-in file is in the right directory and executable (chmod +x or right-click and check permissions).

I've discovered my problem. I don't know how to install python plugins. So far I've been searching the documentation and I've found nothing.

In linux, plug-ins go into: /home/USERNAME/.gimp-2.6/plug-ins/
(replace USERNAME with your own user name)

If the file is named like plugin_name.py.txt, then remove the .txt extension so it's named plugin_name.py

The file must be executable. Either do 'chmod +x plugin_name.py' in a terminal or right-click the file, select 'properties', then check the box for 'Execute'.

A little more info here: http://en.wikibooks.org/wiki/GIMP/Installing_Plugins#GNU.2FLinux

HTH,
Chris

Hello Cr33dog,
I try your plugin and it works.

I want to make CMYK separation for silkscreen print. I need a tool to save the four layers generated by separate+ because gutenprint can't print the layers one by one.

Even if it work wonderfully I've got a trouble with your plugin : the fact that it save the layers to PNG format (made for web not for print).

What part of the code could I change to save layers in another format(Tiff)?

Tia

PNG is a lossless format, and is more suitable for printing than the TIFF format. (TIFF with compression causes slight information loss).

So again - PNG is not just "made for web". Did you have any specific problem printing the PNG file(s)?

No trouble for using the script and printing the PNG
Thank again for it and your prompt answers

To save as tiff instead then png I would change this line that is just close to the register block

"pdb.file_png_save(tmp, tmp.layers[0], fullpath, name, 0, 9, 1, 1, 1, 1, 1)"
just replace at beginning "pdb,file-png-save" with "pdb,file_tiff_save"

I didn't tested

Pages

Subscribe to Comments for "Export Layers as PNG"