4

Possible Duplicate:
Batch “resize” JPEG images to a fixed file size
fast batch image resizer

I have thousands of images (90 GB) mostly documents, and employee related stuff like passport copies..etc. Most of these documents are over sized and scanned in high DPI (300 or 200). Taking random samples the average size is 500KB-1MB per file and I could resize them or compress them to less than 100KB with little work even using MSPain. Is there any software that will help me in doing this job in an easier way since it is almost impossible to open them one by one and resize them.

5

4 Answers 4

6

Imagemagick can resize images.

convert input.jpg -resize 600x600 output.jpg

Note that this will set a maximum size for each side, but will keep the aspect ratio. So a 1200x1000 image resized with the above command will be scaled to 600x500 pixels, while a 1000x1200 image will be resized to 500x600.

You can, of course, put this in a script. On bash, to convert every *.jpg in a directory to a 600x600 jpg:

for f in ./*.jpg; do convert "$f" -resize 600x600 "${f%.jpg}-resized.jpg"; done

To do the same recursively:

find . -type f -name *.jpg -exec bash -c 'convert "$0" -resize 600x600 "${0%.jpg}-resized.jpg"' {} \;

I don't know how to do those on the Windows command-line/batch script, but I do know it's possible.

If you wish to over-write your original files, you can use ImageMagick's mogrify command:

mogrify input.jpg -resize 600x600

This has the extra advantage of being able to use shell expansion, so you can resize every *.jpg in a directory without resorting to a for loop:

mogrify ./*.jpg -resize 600x600

To use it recursively, you would have to drop it into a find command, as with convert:

find . -type f -name *.jpg -exec mogrify '{}' -resize 600x600 \;
1
  • 1
    You should also look at the related command "mogrify" (a version of "convert"), which replaces the original file with the resized one, instead of creating a new resized file. Otherwise you might need to find a way to delete the originals afterwards.
    – Jost
    Jan 27, 2013 at 22:19
5

Xnconvert (portable) can process thousands of images

In your case you can try

  • set a lower DPI
  • resize to a lower resolution
  • choose another file format
  • choose another compressing method

enter image description here

3

IrfanView would do the job for you. It has a "Batch Conversion/Rename" tool that you can do a lot of things with, including resizing.

From this tutorial on resizing images with IrfanView:

  1. Launch IrfanView and hit the B key. This takes you into batch mode.

  2. Add all files or entire folders to input files

  3. Change the output format and change the quality percentage

  4. use the Advanced option to resize all files

    enter image description here

Note that IrfanView is free for non-commercial use only.

1

FastStone Photo Resizer - easy and simple. Freeware, good GUI and a lot of options. http://www.faststone.org/download.htm

2
  • does it automatically detects a reasonable size for documents or do I have to set a fixed width/height?
    – user165733
    Jan 27, 2013 at 18:04
  • You can resize image based on one side (eg. long) and set output format (and eg image quality in jpg). As a result you get all photos with similar size. I can't imagine any other reasonable way to shrink size of multiple photos.
    – gglon
    Jan 27, 2013 at 18:41