Copy link to clipboard
Copied
Hi
I have a script that uses this snippet of code to save png files for web. But, no matter what number I change the quality, the resulting file size and image fidelity remains the same.
I was wondering if I can save pngs for web at smaller byte size with JSX and how to modify the output settings.
docName = sourceDoc.name;
NamesaveRef = new File( outputFolder + "/" + docName );
var NewfileRef = new File( NamesaveRef )
var options = new ExportOptionsSaveForWeb();
options.format = SaveDocumentType.PNG;
options.transparency = true;
options.blur = 0.0 ;
options.includeProfile = false ;
options.interlaced = false ;
options.optimized = true ;
options.quality = 3 ;//THIS NUMBER DOES NOT CHANGE QUALITY IF CHANGED FROM 0.1 TO 100
options.PNG8 = false ;
sourceDoc.exportDocument(File( NamesaveRef), ExportType.SAVEFORWEB, options);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
Thanks for your help.
Aubrey
Copy link to clipboard
Copied
PNG does not have a quality setting. The quality property is used when exporting jpeg. That is why changing that property has no effect with PNG files.
Photoshop now supports PNG compression but as far as I can tell you have to use Action Manager to save. I don't see a compression option when using saveForWeb.
Copy link to clipboard
Copied
Thank you.
Which version of photoshop supports PNG compression?
Copy link to clipboard
Copied
I think PNG compression was added in CS6.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now