Hi There,
I promise ive searched the community but have limited experience with scripts. =(
We have a simple script written for us by a previous colleague who pointed to a folder, opened - and resized all the images to be 1000 x 1000 pixels then saved that file to a resized folder.
We have updated requirements which means we would like to remove a white or grey background (if possible) and save the file as .webp with a quality of 60 in the same subfolder.
Is this possible? Am I asking too much!? i did try some simple command changes but obv i don't understand it enough
Script below
------------------
// To use this script, place it in Program Files\Adobe\Adobe Photoshop CS6\Presets\Scripts\ and run it from the Scripts option under File in Photoshop.
startRulerUnits = app.preferences.rulerUnits
app.preferences.rulerUnits =Units.PIXELS
var white = new SolidColor();
white.rgb.hexValue = "FFFFFF";
app.backgroundColor = white;
alert("This script only works with .jpg files! It will not process any images that are .png, .gif, .tif etc. Convert any images that are the wrong format first using the Image Processor script in Photoshop.");
var inputFolder = Folder.selectDialog("Select a folder to process");
var fileList = inputFolder.getFiles("*.JPG");
for(var i=0; i<fileList.length; i++) {
var doc = open(fileList[i]);
doc.trim (TrimType.TOPLEFT)
if (doc.width !== doc.height) {
if (doc.width > doc.height) {
doc.resizeCanvas(doc.width, doc.width)
} else {
doc.resizeCanvas(doc.height, doc.height)
}
}
doc.resizeImage(1000, 1000)
doc.changeMode(ChangeMode.RGB);
doc.save();
doc.close();
}
alert("Processing complete! Now all you've got to do is upload them all... :'(");
------
Thanks for taking the time to review.