Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Photoshop 2020 Export Layers to Files taking forever to complete

New Here ,
Mar 06, 2023 Mar 06, 2023

I have a PSD file with hundreds of layers categorized in groups and I am simply trying to export all of the layers as PNG files using File-> Export -> Layers to Files. But every time I do that it seems to go through some batch processing where the tabs in Photoshop (21.2.12 Release) seems to cycle through each layer individually and it takes forever to export a single PNG file. Im talking like one PNG file per 30 minutes?? How do I go about doing this in a much quicker manner, ideally with not having to export each file manually but rather export them all in one shot into separate folders based on the group layer name.

TOPICS
macOS
4.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 07, 2023 Mar 07, 2023

Hang on, please read my instructions again, especially the bolder bit below:

 

Use the Select > Select All Layers menu item or manually select the required layers and then right-click in the Layers panel and select Export As or Quick Export As PNG

 

Edit: Sorry, the top-level layer group and it's contents are treated as a single layer.

 

If you had three top-level layer groups, each containing 5 layers, then selecting all top-level layer groups and using the layer panel right-click export would

...
Translate
Adobe
Community Expert ,
Mar 06, 2023 Mar 06, 2023

Hi @Russ27591138ymen where are you saving your files to? Local HD or ?

Also check your Apple System Preferences/Security and Privacy/Full Disk Access and make sure PS is lised.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2023 Mar 06, 2023

Hi Kevin. Thanks so much for the quick response. Correction to my original post I am running PS 2023. And I am saving the files locally on my hard drive. I added PS to have full disck access as you suggested, quit PS and then re-opened the same PSD and tred to export the files the exact same way and I'm having the same issue where the files are exported soooo slowly. From a system resources perspective the laptop Im running it from seemes fine. My machine has 16GB of RAM and only 13GB are currently in use. 

 

I just now installed PS 2023 on a Windows desktop that I have and I seem to be having the same exact issue. Where it looks like it is cycling through all of the layers in the layers panel but file are not being exported.  It seems to take upwards of 30 minutes to an hour for the first exported file to be produced and then each subsequent exported file gets produced almost 20-30 minutes after each subsequent file and so on and so forth all extremely slowly than I would expect. And at this current rate it would weeks for me export all of the layers as PNG files? 

 

I've also tried with the setting to export 'visible layers only' and I'm having the same results.

 

Any suggestions on what I can try? Thx very much in advance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 06, 2023 Mar 06, 2023

It's an "old" script and has to cycle through each layer/group, making the others invisible, then saving and then repeating. You didn't mention your file properties such as canvas size, bit-depth, colour mode etc. That being said, it shouldn't take that long!

 

A more modern feature is to use Export As from the layers panel. Use the Select > Select All Layers menu item or manually select the required layers and then right-click in the Layers panel and select Export As or Quick Export As PNG if you have set up your quick export options as required.

 

Edit: I forgot to mention that there are also other scripts for the task:

 

https://github.com/Paul-Riggott/PS-Scripts/blob/master/Layer%20Saver.jsx

 

https://github.com/Paul-Riggott/PS-Scripts/blob/master/Layer%20Saver%20Plus.jsx

 

 
And finally, you could also use Adobe Generator - Generate Image Assets:
 
 
There are many scripts available to add ".png" and or other generator codes to all or selected layer names for use with Generator.
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2023 Mar 07, 2023

Thanks so much for the response. I really appreciate it!! Unfortunately it doesnt look like the Export As or Quick Export As PNG will work because that option seems to want to export the layers as a single file instead of exporting each layer as a separate PNG file which is what I need. My PSD file has many layer groups and I need to export each layer from all of the layer groups as separately named PNG files. Is there a specific script you would suggest I could use that would allow me to do something like that. Thx i nadvance : ) 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2023 Mar 07, 2023

Hang on, please read my instructions again, especially the bolder bit below:

 

Use the Select > Select All Layers menu item or manually select the required layers and then right-click in the Layers panel and select Export As or Quick Export As PNG

 

Edit: Sorry, the top-level layer group and it's contents are treated as a single layer.

 

If you had three top-level layer groups, each containing 5 layers, then selecting all top-level layer groups and using the layer panel right-click export would result in 3 separate PNG files, not 15.

 

Edit 2: The above being said, if you select all layers in each layer group, but don't select the layer group, then only the selected layers will be exported when you right click in the layer panel! So all 15 layers would be exported, but the 3 parent groups wouldn't be exported. Please try it!

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 07, 2023 Mar 07, 2023

@Russ27591138ymen â€“ Either the Layer Saver or Layer Saver Plus scripts from Paul Riggott should allow you to save each separate layer inside each parent layer group as a separate file, without saving the layer group as a file.

 

P.S. Please try my Edit #2 in my previous reply.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2023 Mar 08, 2023

Thanks very much Stephen!! Yes that Solution you providedi in that Edit 2 works but it is still so manual. I have many layer groups and sub layer groups so its tedius to go through each group, select them all and then export. The same for the Layer Saver Plus scripts you provided. That one works also but its just as manual as how I descibed for the quick export or export as option. I was hoping I wouldnt have to go through each layer group, select all the layers and export manually, rather there was a solution to export all of the layers as PNG's into folders based on their corresponding layer group. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2023 Mar 08, 2023

@Russ27591138ymen â€“ thanks for the feedback, I hope that the following helps...

 

Option A:

  • Select > Select All Layers...
  • Hold down CMD/CTRL and click on each layer group to exclude/remove from the selected layers

 

Option B:

Use a script to select all layers, but not layer groups (thanks to @jazz-y )!

 

//https://community.adobe.com/t5/photoshop/select-only-the-text-layers/m-p/11017843
// jazz-y

// Select ALL Layers of Specific Layer Kind - Works with layer sets and nested sets!

var AM = new ActionManager
if (app.documents.length) selectLayerKind()

function selectLayerKind() {
    var output = [],
        from = AM.getDocProperty('hasBackgroundLayer') ? 0 : 1,
        to = AM.getDocProperty('numberOfLayers')

    if (to) AM.deselectLayers()

    for (var i = from; i <= to; i++) {

        // Any Layer = 0
        // Pixel Layer  = 1 (including Background layer)
        // Adjustment Layer = 2
        // Text Layer = 3
        // Vector Layer = 4
        // SmartObject Layer = 5
        // Video Layer = 6
        // LayerGroup Layer = 7
        // 3D Layer = 8
        // Gradient Layer = 9
        // Pattern Layer = 10
        // Solid Color Layer = 11
        // Background Layer = 12
        // HiddenSectionBounder = 13

        if (AM.getLayerProperty('layerKind', i) == 1) AM.selectLayerByIndex(i, true) // Change the number as required
    }
}

function ActionManager() {

    this.getDocProperty = function (property) {
        property = s2t(property)
        var ref = new ActionReference()
        ref.putProperty(s2t("property"), property)
        ref.putEnumerated(s2t("document"), s2t("ordinal"), s2t("targetEnum"))
        return getDescValue(executeActionGet(ref), property)
    }

    this.getLayerProperty = function (property, index) {
        property = s2t(property)
        var ref = new ActionReference()
        ref.putProperty(s2t("property"), property)
        ref.putIndex(s2t("layer"), index)
        return getDescValue(executeActionGet(ref), property)
    }

    this.selectLayerByIndex = function (idx, addToSelection) {
        var desc = new ActionDescriptor()
        var ref = new ActionReference()
        ref.putIndex(s2t("layer"), idx)
        desc.putReference(s2t("null"), ref)
        if (addToSelection) desc.putEnumerated(s2t("selectionModifier"), s2t("addToSelectionContinuous"), s2t("addToSelection"))
        executeAction(s2t("select"), desc, DialogModes.NO);
    }

    this.deselectLayers = function () {
        var desc = new ActionDescriptor()
        var ref = new ActionReference()
        ref.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"))
        desc.putReference(s2t("null"), ref)
        executeAction(s2t("selectNoLayers"), desc, DialogModes.NO)
    }

    function getDescValue(desc, property) {

        switch (desc.getType(property)) {
            case DescValueType.OBJECTTYPE:
                return (desc.getObjectValue(property));
                break;
            case DescValueType.LISTTYPE:
                return desc.getList(property);
                break;
            case DescValueType.REFERENCETYPE:
                return desc.getReference(property);
                break;
            case DescValueType.BOOLEANTYPE:
                return desc.getBoolean(property);
                break;
            case DescValueType.STRINGTYPE:
                return desc.getString(property);
                break;
            case DescValueType.INTEGERTYPE:
                return desc.getInteger(property);
                break;
            case DescValueType.LARGEINTEGERTYPE:
                return desc.getLargeInteger(property);
                break;
            case DescValueType.DOUBLETYPE:
                return desc.getDouble(property);
                break;
            case DescValueType.ALIASTYPE:
                return desc.getPath(property);
                break;
            case DescValueType.CLASSTYPE:
                return desc.getClass(property);
                break;
            case DescValueType.UNITDOUBLE:
                return (desc.getUnitDoubleValue(property));
                break;
            case DescValueType.ENUMERATEDTYPE:
                return (t2s(desc.getEnumerationValue(property)));
                break;
            case DescValueType.RAWTYPE:
                var tempStr = desc.getData(property);
                var rawData = new Array();
                for (var tempi = 0; tempi < tempStr.length; tempi++) {
                    rawData[tempi] = tempStr.charCodeAt(tempi);
                }
                return rawData;
                break;
            default:
                break;
        };
    }

    function s2t(s) { return stringIDToTypeID(s) }
    function t2s(t) { return typeIDToStringID(t) }
}

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

 

Let me know how you go!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2023 Mar 17, 2023
LATEST

Looks like I was overthinking it, simply using File > Export As should automatically pick up only the artboards.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines