Copy link to clipboard
Copied
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.
Try:
Group them, then merge group.
Or make Smartobject and rasterize.
@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
...
Copy link to clipboard
Copied
Try:
Group them, then merge group.
Or make Smartobject and rasterize.
Copy link to clipboard
Copied
Thank you so much. You are an angel.
Copy link to clipboard
Copied
@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);
}
}
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
Copy link to clipboard
Copied
😮 WOW
Copy link to clipboard
Copied
😮 WOW
By @S_ A
Thanks, but did it provide the desired result?
Copy link to clipboard
Copied
Hi,
I have tried the first approach. smart object one.
Copy link to clipboard
Copied
I was referring to my script that you commented on.
Copy link to clipboard
Copied
Hi, Yes It did. I tried. Thank you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now