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.
| Attachment | Size |
|---|---|
| 2.72 KB |
Comments
Change line 20 to
Change line 20 to read:
name = img.name + layer.name + ".png"
Trouble using script
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
"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'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:
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
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 not indexed
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
No trouble for using the script and printing the PNG
Thank again for it and your prompt answers
close to " register"
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
Hi Photocomix! After a while
Hi Photocomix!
After a while I found the way to save the layers in tiff.YEEEAAA!
In procedural browser I saw the option "file_tiff_save" and the parameters but I didn't understood how to used it.
I tried to replace the begining of the line"pdb.file_png_save" by "pdb.file_tiff_save" but it didn't work so I give up.
I shake my brain on it and now I've got the solution.
replace the line :
"pdb.file_png_save(tmp, tmp.layers[0], fullpath, name, 0, 9, 1, 1, 1, 1, 1)"
by
"pdb.file_tiff_save(tmp, tmp.layer[0], fullpath, name, 0)"
and the layers are save in tiff format!
@cr33dog
Tiff have no compression( parameter 0 at the end of the line) It is also a lossless format with embedded ICC profil for CMYK print.
Pages