PNG Quick saving too large of files

I tried both the DOM for saving PNG and batchPlay. Both the DOM and batchPlay save identical size files which are about about 30% larger than when saving PNG on the same file through the Photoshop menu using Large or Quick Export.

In Extendscript, the script listener for saving large PNG matches the size of saving through the Photoshop menu.

This is the DOM command which is what I would like to use. Is something not formatted correctly? Or is the PNGMethod quick just not working correctly?

await app.activeDocument.saveAs.png(saveFile, {method: "PNGMethod.QUICK", embedColorProfile: true }, true);

Why this constant is in quotes? In your case it doesn’t resolve to QUICK method, but rather to a simple string. Use constants properly. This might not be the solution - I don’t know, but constants should not be in quotes

Thanks for the info. I ended up with quotes on it because that was the only way it didn’t throw an error. I’m sure it’s not using the value in the quotes though and just defaulting.

However, I did just doublecheck and it actually is saving with the large PNG filesize, same as the PS menu saving. I was wrong about that. It also matches the batchPlay saving too. So I think that Large is the default for the DOM and I can just leave the method out and let it default.

Where I got thrown off which is interesting is that my old extendscript which is also set to save as large is about 30% lower file size on the same files. It uses script listener recorded from an earlier Photoshop version though. The save times are about the same too so I don’t think the extendscript is defaulting to a smaller size because those take forever to save on high resolution PNG. Also, I’ve never seen a 30% difference in PNG size anyway between large and small.

Anyway, I gave I’ll just run with it since it matches what the PS menu does.

It is frustrating that there are no simple 1 line example snippets for how to use the DOM to save an image, at least none that I could find anyway. A 1 line snippet is so much easier to grasp than trying to figure out how to piece things together from the various lists of constants on the webpage. Just seeing a few DOM commands put together makes it a lot easier to understand.