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: Kukurykus, Tom, xbytor

Posts: 6
Joined: Mon Nov 30, 2020 10:04 pm


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
Posts: 132
Joined: Thu Jan 01, 1970 12:00 am

Re: PNGSaveOptions

Post by txuku »


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;