: Photoshop export layers to png but with specific background layer I have a psd with ~400 Layers which contain semitransparent images and one layer with a solid color. I want to export those
I have a psd with ~400 Layers which contain semitransparent images and one layer with a solid color. I want to export those layers to png8 and want that layers to have that solid background. I can export those layers with File->Scripts->Export layers to files, but cannot provide the background option. Any simple way to achieve this?
More posts by @Pierce403
1 Comments
Sorted by latest first Latest Oldest Best
I've found a solution. After searching quite a bit, I finally found an answer. I wrote a little jpx script, though output is now as jpg.
// variables
var destination = "C:/Users/...../"
var doc = app.activeDocument;
var artlayers = new Array();
// jpeg options
var options = new ExportOptionsSaveForWeb();
options.quality = 80;
options.format = SaveDocumentType.JPEG;
// loop through all layers
var x = 0;
var a = 0;
while (x < doc.layers.length) {
// check if the layer is a item
if (doc.layers[x].kind == LayerKind.NORMAL) {
// add to array
artlayers[a] = x;
a++;
}
x++;
}
var x = 0;
var a = 0;
for (x=0; x < artlayers.length; x++)
{
doc.layers[artlayers[x]].visible = true;
// export as jpeg
try { doc.backgroundLayer.visible = true; } catch (e) {}
file = new File(destination + doc.layers[artlayers[x]].name +".jpg");
doc.exportDocument(file, ExportType.SAVEFORWEB, options);
doc.layers[artlayers[x]].visible = false;
}
It's important to know, that the background-layer must be an original photoshop background. If the name of the bg-layer is in italics, you're good to go. also, all layers except the bg-layer have to be invisible/deselected.
have fun! :)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.