Copy link to clipboard
Copied
Hello. I have a script that saves a large image in multiple resolutions to PNG. The image has several layers, some of them are vector-based. Before resizing, I call
app.activeDocument.flatten();
Otherwise, the vectors will not scale (interestingly, this happens only when resizing via script, not manually). However flattening the image removes transparency. Do you have any suggestions on how to deal with this? I'm thinking using script to rasterize all the vector layers before resizing, but perhaps I'm missing a better solution?
How about using merge visible instead?
var idMrgV = charIDToTypeID( "MrgV" );
executeAction( idMrgV, undefined, DialogModes.NO );
Copy link to clipboard
Copied
How about using merge visible instead?
var idMrgV = charIDToTypeID( "MrgV" );
executeAction( idMrgV, undefined, DialogModes.NO );
Copy link to clipboard
Copied
Thank you Chuck. Works great!
Copy link to clipboard
Copied
Flatten merges all layer into a background layer. Photoshop's background is a special bottom layer that is canvas size that does not support transparency. It transparency is locked all pixels are 100% opaque.
Copy link to clipboard
Copied