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

How to convert multiple shape into raterize layer at one go

Enthusiast ,
Jan 19, 2025 Jan 19, 2025

Hi,

 

Is there any way  I can select multiple shape layers and convert them into rasterized layers at one go/simultaneously in Photoshop?

 

I set the shotcut for the rasterizing layer as 'Ctrl+Q' but it doesn't convert all selected shape layers into individual rasterized layers. I have to do it one by one. 

 

I need guidance. please help.  hot yo.jpg

 

 

 

 

TOPICS
Windows
500
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 2 Correct answers

Community Expert , Jan 19, 2025 Jan 19, 2025

Try:

Group them, then merge group.

Or make Smartobject and rasterize.

Translate
Community Expert , Jan 19, 2025 Jan 19, 2025

@S_ A wrote:

Hi,

 

Is there any way  I can select multiple shape layers and convert them into rasterized layers at one go/simultaneously in Photoshop?

 

I set the shotcut for the rasterizing layer as 'Ctrl+Q' but it doesn't convert all selected shape layers into individual rasterized layers. I have to do it one by one. 


 

A script can process multiple selected layers as individual layers. I'll post the code when I am in front of the computer.

 

Update:

 

/*
Rasterize Multiple Selected Layers In
...
Translate
Adobe
Community Expert ,
Jan 19, 2025 Jan 19, 2025

Try:

Group them, then merge group.

Or make Smartobject and rasterize.

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
Enthusiast ,
Jan 19, 2025 Jan 19, 2025

Thank you so much. You are an angel.

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 ,
Jan 19, 2025 Jan 19, 2025

@S_ A wrote:

Hi,

 

Is there any way  I can select multiple shape layers and convert them into rasterized layers at one go/simultaneously in Photoshop?

 

I set the shotcut for the rasterizing layer as 'Ctrl+Q' but it doesn't convert all selected shape layers into individual rasterized layers. I have to do it one by one. 


 

A script can process multiple selected layers as individual layers. I'll post the code when I am in front of the computer.

 

Update:

 

/*
Rasterize Multiple Selected Layers Individually.jsx
v1.0 - 21st January 2025, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-convert-multiple-shape-into-raterize-layer-at-one-go/td-p/15099483
Special thanks jazz-y for the code to work with multiple selected layers
Based on:
https://community.adobe.com/t5/photoshop-ecosystem-discussions/rasterize-flatten-layer-transparency-quickly/m-p/11393469
*/

#target photoshop

// Single history stage undo
app.activeDocument.suspendHistory("Rasterize selected layers", "main()");

function main() {

    // Capture the initial layer visibility and layer selection
    var currentLayersState = getLayersVisiblity();

    // Get the selected layers: courtesy of jazz-y
    var s2t = stringIDToTypeID;
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
    r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
    var lrs = executeActionGet(r).getList(p),
        sel = new ActionReference();

    // Loop over the selected layers: courtesy of jazz-y
    for (var l = 0; l < lrs.count; l++) {

        sel.putIdentifier(s2t('layer'), p = lrs.getReference(l).getIdentifier(s2t('layerID')));
        (r = new ActionReference()).putIdentifier(s2t('layer'), p);
        (d = new ActionDescriptor()).putReference(s2t("target"), r);
        //d.putBoolean(s2t("makeVisible"), false);
        executeAction(s2t('select'), d, DialogModes.NO);

        // Rasterize selected layers
        var s2t = function (s) {
            return app.stringIDToTypeID(s);
        };
        var descriptor = new ActionDescriptor();
        var reference = new ActionReference();
        reference.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
        descriptor.putReference(s2t("null"), reference);
        descriptor.putEnumerated(s2t("what"), s2t("rasterizeItem"), s2t("layerStyle"));
        executeAction(s2t("rasterizeLayer"), descriptor, DialogModes.NO);

    }

    // Restore the initial layer visibility and selection
    setLayersVisiblity(currentLayersState);
}


///// Functions /////

function getLayersVisiblity() {
    // by jazz-y
    var s2t = stringIDToTypeID,
        t2s = typeIDToStringID;
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('targetLayersIDs'));
    r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
    var targetLayers = executeActionGet(r).getList(p),
        seletion = [],
        visiblity = {};

    for (var i = 0; i < targetLayers.count; i++) seletion.push(targetLayers.getReference(i).getIdentifier());
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('numberOfLayers'));
    r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
    var len = executeActionGet(r).getInteger(p);

    for (var j = 1; j <= len; j++) {
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('layerSection'));
        r.putIndex(s2t('layer'), j);
        if (t2s(executeActionGet(r).getEnumerationValue(p)) == 'layerSectionEnd') continue;
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('layerID'));
        r.putIndex(s2t('layer'), j);
        var id = executeActionGet(r).getInteger(p);
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('visible'));
        r.putIndex(s2t('layer'), j);
        var visible = executeActionGet(r).getBoolean(p);
        visiblity[id] = visible;
    }
    return {
        selection: seletion,
        visiblity: visiblity
    };
}

function setLayersVisiblity(layersStateObject) {
    // by jazz-y
    var s2t = stringIDToTypeID;
    for (var a in layersStateObject.visiblity) {
        makeVisible = layersStateObject.visiblity[a] ? "show" : "hide";
        (r = new ActionReference()).putIdentifier(s2t('layer'), a);
        (d = new ActionDescriptor()).putReference(s2t('target'), r);
        executeAction(s2t(makeVisible), d, DialogModes.NO);
    }
    if (layersStateObject.selection.length) {
        var r = new ActionReference();
        for (var i = 0; i < layersStateObject.selection.length; i++)
            r.putIdentifier(s2t("layer"), layersStateObject.selection[i]);
        (d = new ActionDescriptor()).putReference(s2t("target"), r);
        d.putBoolean(s2t("makeVisible"), false);
        executeAction(s2t("select"), d, DialogModes.NO);
    } else {
        (r = new ActionReference()).putEnumerated(s2t("layer"), s2t('ordinal'), s2t('targetEnum'));
        (d = new ActionDescriptor()).putReference(s2t('target'), r);
        executeAction(s2t('selectNoLayers'), d, DialogModes.NO);
    }
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run

 

Scripts are installed in the /Presets/Scripts folder

Mac OS Example:


/Applications<u+2069>/Adobe Photoshop CC 2019<u+2069>/Presets<u+2069>/Scripts
/Applications/Adobe Photoshop 2021/Presets/Scripts

 

(If this path does not match your version, it should be a simple enough process to find the correct folder using this guide)

 

Win OS Example:


C:\Program Files\Adobe\Adobe Photoshop CC 2018\Presets\Scripts
C:\Program Files\Adobe\Adobe Photoshop 2021\Presets\Scripts

 

(If this path does not match your version, it should be a simple enough process to find the correct folder using this guide)

Alternatively, you can use File > Scripts > Browse and navigate to the script file.
 
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
Enthusiast ,
Jan 19, 2025 Jan 19, 2025

😮 WOW

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 ,
Jan 19, 2025 Jan 19, 2025
quote

😮 WOW


By @S_ A


Thanks, but did it provide the desired result?

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
Enthusiast ,
Jan 19, 2025 Jan 19, 2025

Hi,

I have tried the first approach. smart object one. 

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 ,
Jan 19, 2025 Jan 19, 2025

I was referring to my script that you commented on.

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
Enthusiast ,
Jan 20, 2025 Jan 20, 2025
LATEST

Hi, Yes It did. I tried. Thank you.

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