Skip to main content
Inspiring
December 1, 2019
Answered

How to set PNG Export Options, when exporting via PNG file using PNGSaveOptions via script

  • December 1, 2019
  • 2 replies
  • 2235 views

Hello guys,

I would like to set the options of the attached screen shot via script, so that PNG export is fast. 
Is it possibe to ste these options via script?

 

Thanks

Charu

This topic has been closed for replies.

2 replies

r-binCorrect answer
Legend
December 1, 2019
Inspiring
December 2, 2019

Thanks r-bin. 

 

Do I need to change some values in the script,  for using first option of teh screen shot "Large file size" (Fastest saving). 

Compression = 9 means what? It will save file fast or slow?

 

 

Bojan Živković11378569
Community Expert
Community Expert
December 1, 2019

Do you want to ask for Photoshop action and what will be recorded? Below is sample, action step will contain optimization method so the answer in that case is yes. Note: step shown below is recorded using Save As command.

Inspiring
December 1, 2019

Thanks, but is it possible without action. I mean using Photoshop API.

 

Here is what I am doing via script.

 

var url = '/Users/abc/Desktop/test.png';
var img = new PNGSaveOptions();
img.compression = 0;
app.activeDocument.saveAs(new File(url), img, true, Extension.LOWERCASE);

So, I am using this script, is there a way to specify quick method here?
Bojan Živković11378569
Community Expert
Community Expert
December 1, 2019

I am not script guy so you must wait for someone else to respond.