Skip to main content
Known Participant
September 21, 2012
Question

Resize batch images to a file size

  • September 21, 2012
  • 3 replies
  • 5887 views

Is it possible script resizing images (down) to specific file sizes? For example, just as a sample, I have a folder with a 150mb, 100mb and 75mb image (different images). And I want different file size versions of each image... so with the 150mb file the script would create a 100mb, 75mb, 50mb, 30mb, 20mb and 10mb version... with the 100mb file the script would create 75mb, 50mb, 30mb, 20mb and 10mb version and with the 75mb file the script would make the 50mb, 30mb, 20mb 10mb versions.

So basically I want to end up with images resized down to set mb sizes and not resized to set pixel sizes.

Thanks, Tim

This topic has been closed for replies.

3 replies

Inspiring
September 22, 2012

I am still not clear if the size in mb is the open document size. If so and the image is a RGB with a single background layer I have some code that will resize to an open document size in mb( or at least very close, if you request 100mb the size will be as close as it can get without changing the apsect ratio.

Inspiring
September 22, 2012

Mike, I would be very concerned if these were *.jpeg files and that 100mb was NOT the open/uncompressed data size…? Im guessing that the OP wants a routine that opens images and resamples based on pixel width x height… I'm however skeptical that all the resizes are required though…

c.pfaffenbichler
Community Expert
Community Expert
September 23, 2012

I'm however skeptical that all the resizes are required though…

In one of the posts the OP explained (if I understood correctly) that the intent is to switch in the images closest to the effective resolution in Indesign-documents via an Indesign-server to save on exporting time when downsampling in the export.

With high volume this may be a considerable savings.

c.pfaffenbichler
Community Expert
Community Expert
September 21, 2012

Care to elaborate on the file format you are talking about?

And, to be blunt, whatever good is this supposed to be?

talltim1Author
Known Participant
September 21, 2012

Yes, our file formats are JPEG. Most are around the 75mb mark but we do have some larger ones. Basically our service is an automated online web2print service and some of the images are large as there can be smaller crops into portions of the image, and they have to be able to print on our products that vary very much in size. This is leading to some long PDF/render times from our Indesign server and we are getting these times down. A big saving is to have the same images at various sizes so our system picks up the closest image size before making a PDF... in testing there is big savings in rendering time if you have a few images on a product and the sizes when downsampled are in the 5- 20mb range, then it's much faster having jpegs already around that size so not much resizing is going on, rather than Indesign server having to go to images that are 75mb, 100mb, 150mb and downsampling to 5, 10 or 20mb. Anyhow, it is looking at this stage we will get Imagemagik to do the resizing task.

Thanks, T

c.pfaffenbichler
Community Expert
Community Expert
September 21, 2012

The time-savings regarding down-sampling can of course be relavant.

But I think it is not the size the image has on disk that should be considered but the effective resolution in Indesign.

Paul Riggott
Inspiring
September 21, 2012

There is no easy way to do this, you would need to save the file, check it's size, if it's too big resave as a lower quality.

The size of files you are talking about do not seem to be JPEG, so the only way you could reduce, PDF, PSD, TIF etc would be to reduce the document dimentions.

I do not think it is a viable option doing this.