Photoshop Scripting HELP! Basic resizing is losing quality and wracking my brain!
- August 28, 2022
- 8 replies
- 1472 views
I am using Photoshop 2020, on a windows 10 machine.
I have searched all sorts of photoshop scripting websites and I cannot seem to find a solution that works. I have a large image (6480x6480 pixels). In photoshop I can manually resize it to 648x648 and the details look well preserved (the 'diamonds' inside the letter T). BUT, when I try to resize using a script, I lose key details, where my 'diamonds' are now blurred out to what looks more like 'chrome'. fyi: The PSD file is file that applies a text effect (in this case, diamonds) to the inside of whatever you set your text string to be.
If I take my origianl 6480x6480 psd file and zoom till it is down to 10%, I can still see the jewelled diamond detail.
The script line I use to resize is:
app.documents[0].resizeImage (648, 648, 300, ResampleMethod.BICUBICSHARPER);
Even before I save the image as JPEG or PNG, you can already see the detail is lost even though I keep the resolution at 300 pixel/inch!
--- prior to the code line above, I initially tried this --
app.preferences.rulerUnits = Units.PIXELS; // use pixels
var sfw = new ExportOptionsSaveForWeb();
sfw.format = SaveDocumentType.PNG;
sfw.PNG8 = false; // use PNG-24
sfw.transparency = true;
// a bunch of code that successfully save the full size image and PNG files with NO LOSSES
app.documents[0].layers.getByName("Watermark").visible = true;
app.documents[0].layers.getByName("Background").visible = true;
app.documents[0].resizeImage(600, 600, null, ResampleMethod.BICUBICSHARPER); // width, height
var destFileName = "Blog6006Black.png";
app.documents[0].exportDocument(new File(destFolder + "/" + destFileName), ExportType.SAVEFORWEB, sfw);
... at this point I think I would even be happy with a script that does just a screenshot of my original large file as it appears inside photoshop
