Pages: [1]   Go Down

Author Topic: Trying to use Photoshop CS6 to batch save to specific file size... how?  (Read 1685 times)

earlybird

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 331

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.
Logged

howardm

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1984
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #1 on: February 21, 2019, 08:12:39 pm »

Have you tried Files > Scripts > Image Processor ??

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #2 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.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

earlybird

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 331
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #3 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.

Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #4 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.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

earlybird

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 331
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #5 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. :-)
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8913
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #6 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
Logged
== If you do what you did, you'll get what you got. ==

earlybird

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 331
Re: Trying to use Photoshop CS6 to batch save to specific file size... how?
« Reply #7 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.
 
Logged
Pages: [1]   Go Up