Batch export Photoshop layers to individual PNG files


Question

I am a web dev and competent in Fireworks, but not so much in Photoshop.

I have just received a layered PSD file to turn into a web page. Can anyone tell me the easiest way to export all layers to individual png files?

There are lots of layers and doing this manually seems wrong.

I have seen this but it does seem there should be native functionality for this in PS.

I have access to Photoshop CS4. Any pointers appreciated.

1
131
1/24/2017 11:40:00 AM

Accepted Answer

Method 1: The Built-In Script from Adobe

File >> Scripts >> Export layers to files...

enter image description here

Here are some related questions...

Exporting individual layers in Photoshop, keeping their sizes

Export Layers to Files exports only 4 png files from 100 layers


Method 2: Custom Script

I spent some time and wrote my own script file to automate this process. This process is much faster than the built-in script mentioned above.

Get the script now on Github!

Additional Information

I ran this script on a 100 layer, 450MB file in under 60 seconds. Running the built-in script on the same file takes me about 30 minutes.

When testing with nest layer groups, I found that my script runs in about 90 seconds whereas the built-in script takes about 27 minutes (and actually exports it wrong).

Please note that these results will vary depending on the complexities of the files as well as the hardware on your computer and the version of Photoshop. Additional performance data.

This script has (over the past few years) gotten various improvements from various contributors. If you run into any issues with the script. You can files issues with the script here.

Please read through the read-me for any additional, additional information.

Disclaimer: This script is not associated with Adobe in any way. Please use script at your own risk -- always make a back-up of your PSD before using. I am not responsible for any damaged or lost data.

159
4/13/2017 12:46:00 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow


Website under construction!!!
^