Go Premium for a chance to win a PS4. Enter to Win


Photoshop CS5:  Export Layers to PNG

Posted on 2010-11-29
Medium Priority
Last Modified: 2012-05-10
Hi All,

I've been given a PSD file with 300 icons, each is there own layer.

Is there an easy way to trim and export all layers to PNG?
Question by:detox1978
  • 4
  • 3
LVL 12

Accepted Solution

Craig Bowman earned 1400 total points
ID: 34233013
I know this worked in CS3, but have you tried  File > Scripts > Export Layers To Files?

Author Comment

ID: 34233059
looks promising, I'll give it a try and let you know how i get on.

Author Comment

ID: 34234664
Ok that works, but takes far too long - around 2 hours per PNG as it cycles through every image one at a time just to create one PNG.  As there's 300 PNG's to create it would take weeks.

Is there a method that efficiently?  

I.e just exports each layer, without cycling through every layer first.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 26

Assisted Solution

by:David Brugge
David Brugge earned 600 total points
ID: 34234783
300 layers is really not that many to have to deal with.

Short of writing a custom script, (which shouldn't be to hard since you already have the basic write Layers to Files script as a source, my suggestion is a method of divide and conquer.

If a file with 300 layers takes 2 hours, then a file with 150 layers should take only a hour, etc.

Open the file and drag, oh say, 25 layers into it's own file. Then run Layers to Files script. If the time is reasonable, proceed with the next 25. If it is still taking too long, make the number something like 10 layers.

If this is still more time than you want to spend, hire some kid to do it for you one layer at a time.

The solution is not elegant I admit, but sometimes you need to just do what you need to do in order to get on down the road.

Author Comment

ID: 34234862
Divide and conquer is probably going to be the quickest solution.

I found this script on the internet;

Where he hides each layer one at a time (the PhotoShop built-in script duplicates them), is there a way this script could be edited so it hides all layers and just displays the one I want?

Alternatively does photoshop have a macro recorder similar to MS Office?
LVL 26

Expert Comment

by:David Brugge
ID: 34235094
>is there a way this script could be edited so it hides all layers and just displays the one I want?

Yes, but I'm not the goto guy for coding advice. I'm still in the fumbling around stage with javascript.

>Alternatively does photoshop have a macro recorder similar to MS Office?

Yes, Photoshop has a macro recorder, the Action Script, but it can only record actions that do not require logic. For instance, you can record a script that hides a layer, but when you run the script, it will keep trying to hide the same layer. You can't instruct it to hide the next layer each time you run it, for instance.

On the other hand, if you just want to use brute force to do this, you can record an action that sames the current image as a png to a specific location and assign it to a hot key. Then it is just a matter of hiding a layer and hitting a hot key.

The slowdown with this method is that you have to pause to name each file as you save it. There isn't an automatic naming protocal that will let you keep saving files to the same location.
LVL 26

Expert Comment

by:David Brugge
ID: 34235167
As far as the automatic naming when using an action. I have had to use this brute force method a number of times.

I save the name of the file to the clipboard, then paste the file name in along with the first two digits of a three digit number and simply add the final digit. After ten saves, I backspace one digit, enter a new one, save it to the clipboard and proceed.

The workflow is then...(where F1 is the hot key that I assigned to my action)

Hide layer >> F1 >> Ctrl+S >> + digit >> [Enter]

LVL 26

Expert Comment

by:David Brugge
ID: 34235187
Opps! delete the Ctrl+S. That part is included in the action, I meant Ctrl+V to paste the file name.

It should read...

Hide layer >> F1 >> Ctrl+V >> + digit >> [Enter]

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The Summer 2017 Scholarship Winners have been announced!
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question