Gimp: Export every layer as a separate PNG image
Solution 1
You may try also this plugin, Export Layers. I've tested it with png format and it worked. You just select the folder and the format and you get all the layers there, each one in its own file.
Solution 2
If PNG is an acceptable output format, one option is to export it as Open Raster (.ora), an open specification for layered-image files.
-
Export Image as Open Raster (.ora)
File -> Export As ...
myfile.ora
-
Open
myfile.ora
as an archive, with a program likefile-roller
or7zip
.On Ubuntu:
$ file-roller myfile.ora $ # note, later version of file-roller on ubuntu hard-code file suffixes, # and refuse to open ".ora" files, work around by renaming the file to ".zip" $ ln -s myfile.ora myfile.ora.zip $ file-roller myfile.ora.zip
alternatively
$ unzip myfile.ora
All your layers will be png images under
/data
, Extract them and use at will.
Solution 3
First of all you don't need any plugin. Even you don't need to crop anything. Few simple steps.
- Select a layer. To do that just click on that particular layer.
- Copy the layer to a clipboard using Ctrl+C
- Now create new image using Ctrl+Shift+V
That's it. Now you can simply export that layer to any format.
- Use Shift+Ctrl+E
Solution 4
One could export the image as an animated GIF. This will save each layer as a separate frame in the GIF.
Then, the ImageMagick command convert -coalesce ./myfile.gif outfile%05d.png
will extract the frames as PNG images.
Solution 5
Certainly, this work for the plugin Export Layers to File.
Features:
- Manipulate the layers in layer group.
- Export texts, patterns and layer filters.
- Prefix name for the image files has to be given.
- Export only in jpg, png, bmp formats but the required formats can be added easily.
Related videos on Youtube

Parto
Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows neither victory nor defeat. ― Theodore Roosevelt
Updated on September 18, 2022Comments
-
Parto 3 months
I have come to a situation where I have an image in Gimp with multiple layers. Now, I want to export every single layer as an individual image (PNG format preferably) automatically to a folder somewhere.
Is this possible?
The long method: Hide all layers except one, crop the section you want, export image. Hide saved layer, unhide another one, crop section, export. Repeat. Kinda cumbersome for an image with about 20 layers.
-
Jeff Puckett about 3 yearsParto please consider accepting the answer by @ThorSummoner askubuntu.com/a/749561/453746 as it seems to be a much better solution for new people finding this answer today without installing a plugin.
-
-
Parto over 8 yearsThis was the easiest. Extract the file, copy the .py file to your ~/.gimp-2.8/plug-ins folder, make it executable, restart GIMP.
-
installero over 8 yearsDoesn't work in GIMP 2.6 btw.
-
moi over 6 yearsThis is also availabe at GitHub: github.com/khalim19/gimp-plugin-export-layers
-
LowFieldTheory about 6 yearsthis was awesome, thanks- I think this is the best solution. Nothing to install and very fast. I just did it with GIMP with a PSD.
-
Petah about 6 yearsThis exported a flattened image for me :(
-
VIK over 5 yearsExcellent way to do this! Thanks. Works fine in Gimp 2.8.20.
-
GhitaB over 5 yearsThe best. You saved my day.
-
Deleplace over 5 yearsVery nice. Note that numbering starts with top layers, while some other techniques would start with bottom layers.
-
clickbait over 4 years(+1) Cool answer!
-
ether_joe over 4 yearsthe installation instructions for this plugin are stupid. :P Just install please, I don't care about directories.
-
user272901 over 4 yearsAgreed that the installed (for linux) is rough; this is the command I needed to use to make it work with an AppImage GIMP install: ./export_layers-3.2.1-linux.run --target /home/myname/.config/GIMP-AppImage/2.10/plug-ins/ -- -g /path/to/gimp-git-2.10.5-20180719.glibc2.15-x86_64.AppImage -i /home/myname/.config/GIMP-AppImage/2.10/plug-ins/
-
Job over 4 yearsThe link no longer works, but searching for the plugin name turned up: khalim19.github.io/gimp-plugin-export-layers Is that the plugin you were referring to?
-
Akshay Vijay Jain about 4 yearsuse the link provided by job
-
Skippy le Grand Gourou about 4 yearsFurthermore, for large images
convert
takes ages whileunzip
ing an ORA file is almost instant. Good idea, though. -
Murshid Ahmed over 3 yearsIf you only wanted specific layers, then this is the better way to go...
-
spacer GIF over 3 yearsLooks like ORA support was dropped in 2.10. :(
-
ThorSummoner over 3 years@spacerGIF can you cite the removal? Your sure your not mixing up save vs export either right?
-
spacer GIF over 3 years@ThorSummoner Couldn't find any references to this online, but in 2.8 I used this technique many times and in 2.10 I no longer can. Yes, I am in the Export menu, not Save.
-
Michael over 3 yearsthe only issue i have with this is that it doesn't use my layer names as file name, which means that i have to manually map them
-
ThorSummoner over 3 years@michael yikes, I'd guess the metadata is there in the ora somewhere, might be easy thing to script, at that rate I'm not sure why or what it takes to write a gimp export extension to do the right thing the first place
-
ThorSummoner over 2 yearsI noticed that recent Ubuntu distributions, file-roller might not be happy about opening an ora file, if this is troubling you, adding a
.zip
to the end of the file name may help convice your given ziptools to extract it -
Saren Tasciyan over 2 yearsAnother issue is that the image sizes are now limited to layer sizes. e.g. if you have a layers, which has transparent boundaries, then exported image of that layer is smaller than the image itself.
-
ThorSummoner over 2 years@Genom good call out, as a work around, does resizing each layer to match the image size help in this case?
-
FeRD over 2 yearsNot only does this still work great with 2.10.20, but there's even a
stack.xml
file in the archive that includes all of the layer parameters. A sed pipeline can make quick work of whipping up a set of commands to restore the original layer names:cat stack.xml |sed -e 's/><layer/\n/g;' |sed -E -e 's/.*name="([^"]*)".*src="([^"]*)".*/cp "\2" "\1"/;'
-
FeRD over 2 years(In fact, as GIMP is exporting the ORA file, you can even see it dumping all of the layers into a temp directory AS INDIVIDUAL PNG FILES before it proceeds to zip them all up. If we could halt that export process one step sooner, we'd be done already.) 😎
-
FeRD over 2 yearsSo, turns out the exporter for ORA files is written in Python. See my answer for why that matters.
-
FeRD over 2 yearsAlso, if you only wanted two or three layers. Not so great if you find yourself (as I did yesterday) wanting to export each and every one of the 79 frames in an animated gif.
-
deepthought-64 almost 2 yearsWorks very nice! Thanks!
-
ernstkl almost 2 yearsHilarious, thanks! On windows, I had to add a target path like this, because otherwise it tries to write to c:\windows\system32:
savefn(img, lay, 'c:\\temp\\'+outname, outname)
-
FeRD almost 2 years@ernstkl Ah, yeah, that probably makes sense. I'll incorporate a full-path example as well, since launching graphically is surely way more common the running
gimp
from a terminal like I did. (You can actually write that path without doubling slashes using raw strings (r"C:\temp\"
), or as"C:/temp/"+outname
since Python has supported separator translation on Windows for a while now. The "most correct" canonical form would probably beos.path.join("C:", r"\temp", outname)
but that's pretty ugly. And kind of pointless when the path is entered directly, rather than stored in a variable.) -
rautamiekka over 1 yearORA export works perfectly fine in 2.10.26 (at least on Window$). It's very slow, but it works. gitlab.gnome.org/…
-
pipe 10 monthsThis worked well for me, but there are issues with transparency. I did not need it in my project but I don't think it will work if you need to preserve the layer transparency/alpha mask.
-
brunetton 9 monthsThis doesn't answer to the question "I want to export every single layer as an individual image (PNG format preferably) automatically" as this method is not automated