Why my 16 bit psd image is save as 48 bit png image when I use js script ?
I use those js scripts.
This script just does "saveAs png exporting", but it always saves my 16 bit psd image as 48 bit png file.
var doc = activeDocument;
var exportPath = doc.fullName.toString().replace(/\.psd$/, '.png');
var newDoc = doc.duplicate();
fileObj = new File( exportPath )
pngOpt = new PNGSaveOptions();
pngOpt.interlaced = false;
activeDocument.saveAs(fileObj, pngOpt, true, Extension.LOWERCASE);
newDoc.close(SaveOptions.DONOTSAVECHANGES);
and this script, it just does what I need. It saves my 16 bit psd image as 24 bit png image(or 32 bit png image if it contains alpha channel.).
preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument;
var exportPath = doc.fullName.toString().replace(/\.psd$/, '.png');
var newDoc = doc.duplicate();
var webOpt = new ExportOptionsSaveForWeb();
webOpt.format = SaveDocumentType.PNG;
webOpt.PNG8 = false; // PNG-24
var newFile = new File(exportPath);
newDoc.exportDocument(newFile, ExportType.SAVEFORWEB, webOpt);
newDoc.close(SaveOptions.DONOTSAVECHANGES);
I don't know why 1st script always makes 48 bit png image.
Is it caused by limitation of "saveAs" command? I need to use saveforweb to make 24 bit png image?
