Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a largish PSD file with a couple of hundred layers, that I would like to extract selected areas from into PNG files.

Areas can consist of a couple of layers.

Being new to Photoshop, I have been using the following workaround. Duplicate needed layers into a new scratch PSD file of same size, TRIM to transparency, Save As PNG, undo TRIM, hide layers, rinse and repeat...

I suppose I could do it without the scratch file and just crop selection, Save As PNG and undo, but there must be a nicer method.

What other ways are there to accomplish this export of a selected area to PNG?

EDIT: This is on Windows Xp running Photoshop CS3 Extended

share|improve this question
up vote 28 down vote accepted
  • Make your selection
  • Edit -> Copy Merged
  • File -> New (Photoshop should automatically suggest a new canvas size to match the selection size)
  • Edit -> Paste
  • File -> Save As (PNG)
  • Rinse and repeat... (keyboard shortcuts are handy here)

(Tested on Photoshop CS4)

share|improve this answer
Thank you, this is exactly what I was looking for! – Aniti Nov 3 '10 at 10:05
Photoshop engineers should seriously think about improving this because it's tedious to do something so simple with 6 steps, it should have, at most, 2 steps, select and export. simple isn't it ? – Pedro Lobito May 15 '12 at 15:50
I beta test for Adobe for almost 10 years. I have asked for a new interface every single year. Photoshop UI is obtrusive, annoying, vintage from the nineties. At one time someone there asked me to stop asking for this stuff, because I was filling too many feature requests and creating "noise" on their system. How can I company bash a beta tester for suggesting improvements is beyond me. – SpaceDog Jan 13 '14 at 8:33

Try selecting the areas with the Slice tool and then File > Export for web & devices.

share|improve this answer
I have been using this method more and more as compared to the original answer. Presumably, this is what Photoshop developers intended to be used for this particular problem. – Aniti Sep 4 '12 at 8:18
+1 better than the accepted answer, especially if you need to repeat this procedure a lot. – uval Apr 14 '15 at 17:04
this doesn't work for any selections that aren't rectangular and parallel to the edges of the image, whereas the above method works for all shapes and sizes – think123 Jan 2 at 0:22
@think123 True. Yet the resulting PNG is still rectangular. You could use a mask to make the shapes you want to have in the resulting Slice export. – Tomas Andrle Jan 2 at 23:16
@TomasAndrle I am trying to extract scanned pictures - I have scanned four or so images together onto one large scan file, except these pictures were not positioned exactly straight, so it's difficult for me to slice them effectively. – think123 Jan 2 at 23:20

I tackled this by creating a script that I put in Presets\Scripts\Export Selection to PNG.jsx

The code as follows:

app.displayDialogs = DialogModes.NO;

var pngSaveOptions = new PNGSaveOptions();
pngSaveOptions.compression = 9;

var hasSelection;
var docRef;
try {
    hasSelection = !!app.activeDocument.selection.bounds;
} catch (err) {
    hasSelection = false;

if (hasSelection) {
    var w = app.activeDocument.selection.bounds[2];
    var h = app.activeDocument.selection.bounds[3];
    docRef = app.documents.add(w, h);
} else {
    docRef = app.activeDocument;
var file = File.saveDialog("Export as PNG to...");
if (file && ((file.exists && confirm("Overwrite " + file +"?")) || !file.exists)) {
    docRef.saveAs(file, pngSaveOptions, !hasSelection, Extension.LOWERCASE);
    if (hasSelection) {

The script above will handle no-selection as a "select all" and checks if the target file exists confirming an overwrite.

This script is triggered from the File->Scripts->Export Selection to PNG

share|improve this answer

Make a selection. Then hit Ctr or CMD + J to copy that selection into a new layer. then:

File -> Scripts -> Export Layer to Files...

Export Layers to files

If your layer is smaller than the full width/height of the canvas don't forget to check Trim Layers.

share|improve this answer
The question is not about exporting layers to files. It is about saving a selection as a file. The question specifically states "Areas can consist of a couple of layers." – Mike Fitzpatrick May 19 '12 at 5:35

You must log in to answer this question.

protected by Community Jul 1 '13 at 7:44

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .