Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For various reasons I want to scale down a couple of images so that they have a specific file size. I want to convert gif, tiff and jpeg files.

Is there any tool that allows me to do that with a batch?

share|improve this question
You can do this with GIMP or Photoshop quite easily, just Google batch resize with either program name. – Breakthrough Jun 19 '12 at 19:07
I can find tutorials that show me how to batch process images to resize based on image resolution. But I can't find an explanation on how I can do that based on image file size. – RoflcoptrException Jun 19 '12 at 19:37
You might take a look at ImageMagick for accomplishing this, it is a powerful tool with many features. – jmreicha Jun 19 '12 at 20:52
How specific do you want the file size to be? Down to the byte? Kilobyte? You could probably do it with a script and ImageMagick - compress, check file-size, compress more or less depending on how much bigger or smaller than the target it is, repeat until close enough.. – Blorgbeard Jun 19 '12 at 22:52

In GIMP when you save a JPG, you can preview the output as you play with the compression level and it estimates the output file size. I believe this is the closest to what you're looking for. And I believe it only does this for JPGs.

share|improve this answer

There is also IrfanView which is a free download that would allow you to batch resize. Download Here.

share|improve this answer

In spite of being a late response, hopefully my answer will benefit some.

You can do exactly what you want with Batch Images:

Step 1: Add images however you want (all files in folder, by searching for specific files, etc.) Add images

Step 2: Actually called step 3 in the program is where you specify the desired out file names, image file format, and most importantly target file size (which is what you want): Output settings

As you can see there is a "Resize to fit" option (under File size) where you specify the file size. Under advanced options the program offers additional tweaks: additional options

Here you can specify how close you want the size to be matched (it cannot be exactly the size you specify to the byte, because of image format limitations and other reasons that have to do with information compression). You can also specify resampling algorithm used which affects quality / sharpness at the expense of the resulting dimensions: the sharper the image the more bytes it needs per given number of pixels, but because the final file size is constrained, it ultimately results in image being shrunk dimension-wise even more.

Disclaimer: I am using a paid version of this product, and have actually used this feature on many occasions, and most of the time the results are very closed to the specified file size.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .