PNGSaveOptions

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

IanC
Posts: 8
Joined: Mon Nov 30, 2020 10:04 pm

PNGSaveOptions

Post by IanC »

I can't work out why this isn't saving an uncompressed PNG? Would be grateful of any suggestions!

Code: Select all

pngOpts = new PNGSaveOptions();
pngOpts.compression = 0; // 'false' also doesn't work
pngOpts.interlaced = false;

canvas.saveAs((new File(subF+'/'+basename)),pngOpts,false);
The PNG options last used (manually) seem to stick.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: PNGSaveOptions

Post by txuku »

Bonjour

you must consult the javascript help - here
C: \ Program Files \ Adobe \ Adobe Photoshop CC (64 Bit) \ Scripting \ Documents
and search for "ExportOptionsSaveForWeb"!

I have this lying around on my pc:

Code: Select all

var exportOptions = new PNGSaveOptions();
//var type = ExportType.PNG24;
var fileSpec = new File(docP+"/"+docN+"__"+numbering+".png");
exportOptions.antiAliasing = true;
exportOptions.transparency = true;
exportOptions.saveAsHTML = false;
app.activeDocument.saveAs(fileSpec,exportOptions,1,Extension.LOWERCASE);