3 Replies Latest reply on Sep 10, 2013 11:27 AM by Michael L Hale

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

    Aubreyff Level 1

      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