Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

JSX Save PNG for web, quality parameter not changing file size

New Here ,
Sep 10, 2013 Sep 10, 2013

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

TOPICS
Actions and scripting
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Sep 10, 2013 Sep 10, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 10, 2013 Sep 10, 2013

Thank you.

Which version of photoshop supports PNG compression?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 10, 2013 Sep 10, 2013
LATEST

I think PNG compression was added in CS6.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines