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

4 Answers 4

  • 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)

  • 26
    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 ? Commented May 15, 2012 at 15:50
  • 6
    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.
    – Duck
    Commented Jan 13, 2014 at 8:33
  • Keyboard shortcuts for these steps: 1. ctrl + shift +c, 2. ctrl + n, 3. ctrl + v, 4. ctrl + s. 5. ctrl + w
    – Mahn
    Commented Jul 22, 2018 at 19:55

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

  • 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
    Commented Sep 4, 2012 at 8:18
  • +1 better than the accepted answer, especially if you need to repeat this procedure a lot.
    – Amir Uval
    Commented Apr 14, 2015 at 17:04
  • 1
    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
    – Zerium
    Commented Jan 2, 2016 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. Commented Jan 2, 2016 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.
    – Zerium
    Commented Jan 2, 2016 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

  • I improved Archimedes' answer by making the new document call open on a transparent background, and by trimming before the save. You can find the updated script here: pastebin.com/tmk2h8yp
    – Emperorlou
    Commented Jul 7, 2022 at 18:47
  • app.activeDocument.selection.bounds contains [xMin, yMin, xMax, yMax], so var w = app.activeDocument.selection.bounds[2] - app.activeDocument.selection.bounds[0]; var h = app.activeDocument.selection.bounds[3] - app.activeDocument.selection.bounds[1];
    – networm
    Commented Jul 24, 2023 at 3:24

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.

  • 1
    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." Commented May 19, 2012 at 5:35

You must log in to answer this question.

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