Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: earlybird on February 21, 2019, 07:55:34 pm

Title: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: earlybird on February 21, 2019, 07:55:34 pm
Hi,
 I have a project with 44 large .tif photos that need to be reduced to JPEGs with a 125kB file size limit to meet an arbitrary specification.

 I have been trying to make an action that will do it. I have all sorts of home made actions that will reduce pixel dimensions at some specific JPEG compression rating. I have tried making an action with "Save for Web" and the "optimize to file size option" but the action doesn't work as I had intended.

 Using Image Ready for one offs is possible but it takes so long to load the tif files, that I feel the need to automate the process so I can walk away and let the computer work.

 I am trying to use this as Photoshop learning opportunity but am beginning to suspect that I may have to resort to one of the free standing file converters that seem, or at least I think they seem, to do this sort of thing.

 Is it possible to do this as a batch in Photoshop?

 Thank you.
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: howardm on February 21, 2019, 08:12:39 pm
Have you tried Files > Scripts > Image Processor ??
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: digitaldog on February 21, 2019, 08:16:39 pm
All you need to do is build an action for what you wish to do. Then File>Automate>Batch, load the action from the dropdown Action menu.
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: earlybird on February 21, 2019, 09:19:35 pm
As mentioned above, I have made numerous actions and used the File/Batch/Automate function for many functions. One such example is saving tifs as JPEGs to specific pixel dimensions, colorspace, and "quality" level (usually 12 or Maximum).

The catch that I am finding difficult is assigning a specific file size target. I can do it as a one off with "Save for Web" and "Optimize for File Size", but when I record this process as an Action the script saves the resulting quality level rather than the file size target. For example; I "Optimize for File Size" with a setting of 125kB with a proxy .tif file and the resulting quality setting is automatically determined to be "66". The action stores the "66" rather than the "125kB" parameter.

I did not mention it specifically, but I am also somewhat familiar with "File/Scripts/Image Processor and do not know of any way to use it to automate an arbitrary file size limit.

Hence, the original question. Is it possible to use Photoshop to do what I m trying to do?

Thank you.

Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: digitaldog on February 21, 2019, 09:26:10 pm
The catch that I am finding difficult is assigning a specific file size target.
You mean you always what a JPEG that's a fixed size on the disk, like 149K? Can't do that. The compression is image specific even with the same setting (say 9). Might be 140K, might be 190K. Depends on the image content. Take an image with lots of colorful detail and then an image of solid gray and save as JPEG using the same value, again say quality 10. They will differ in size on the disk. The gray will be much smaller than the complex image even using the same pixels width/height as the complex image.
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: earlybird on February 21, 2019, 10:19:19 pm
That is correct I want to automate Photoshop's or Image Ready's built in function, which is labeled "Optimize for File Size".

If it is simply not possible, then I should stop trying to learn how to do it. :-)
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: Bart_van_der_Wolf on February 22, 2019, 04:33:28 am
That is correct I want to automate Photoshop's or Image Ready's built in function, which is labeled "Optimize for File Size".

If it is simply not possible, then I should stop trying to learn how to do it. :-)

Hi,

I know that ImageMagick has that capability.
https://stackoverflow.com/questions/6917219/imagemagick-scale-jpeg-image-with-a-maximum-file-size

And one can write a script /batchfile for doing that, but then IM is not something for everybody ...

Cheers,
Bart
Title: Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
Post by: earlybird on February 22, 2019, 10:28:57 am
Hi,
 Thank you for offering a good solution.

 I admit, I am intimidated by command line but this may be a good opportunity to learn more about Imagemagick.

 I went ahead and finished this project using "Save for Web" on each image individually and working with the "Optimize for File Size". I sped up the load time in the Image Ready interface by using a batch command to resize all the .tifs to the final pixel dimensions in a temp folder.

 I found that that each time I saved the JPEGs an additional 3kB+/- was added to the predicted file size, so I used a "Optimize for File Size" target of 120kB to make sure the file sizes remained below 125kB.

 Regarding JPEG compression; as has been suggested above, a wide range of "Quality" settings were used to conform all the images to the 125kB target. For example; some images, such as interior scenes with smooth surfaces, were compressed at a quality setting of "50" while exterior scenes with lots of leafy texture, would not reduce below 125kB value at the "0" quality setting.

 When confronted with the impossibility of shrinking the file size below 125kB at the lowest "0" quality setting, I used Topaz Detail with varying negative values for the "Small Details" parameter, and occasionally used a slight reduction in the "Medium Details" parameter, to allow the "Save to Web" function to reduce the file size below the 125kB threshold.

 
 Thank you.