Copy link to clipboard
Copied
I have a client who needs to be able to run a batch process on jpg images ranging in size from 600KB to 2.5MB optimizing their file size as close to 200KB as possible. The feature is included in Photoshop's save for web optimize dialog but it doesn't work for batch processes. If you record an action with the optimize to file size option set it processes all the images in the batch based on the quality settings required to resize the image you used during recording, meaning if the image you recorded was 1.5MB the quality setting might be 70 percent to hit the 200KB mark but that wouldn't be the correct quality setting for a 600KB file nor a 2.5MB file those would either be too small or too large.
I've done quite a bit of searching both online and in the photoshop scripting forums but I haven't been able to find anything that would point me in the right direction.
My client's paying for this work so if there's someone who knows how to script this who'd rather be paid than just do some pointing we can arrange for that quite easily.
Thanks in advance for your assistance and suggestions.
In case it's of importance we're using Photoshop CS4.
Copy link to clipboard
Copied
As far as I can remember, there is no way to specify a desired file size for SFW via any JS API.
The best you can do is perform multiple saves changing the quality each time until you reach your desired file size. It's not very fast, but it does work.
There may actually be code for this posted in a thread over on ps-scripts.com.
-X
Copy link to clipboard
Copied
If you don't mind spending a few bucks on a shareware prog, Jpegsizer has the option to save to a filesize.
You can find it here.
http://www.tangotools.com/jpegsizer/register.htm
There is a free trial version, but you can't save files.