Scaling down large images with imagemagick

A friend of mine is photographing a lot and feels in charge to share his pictures to others via Internet. He suffered from the size of his high-resolution pictures taken en masse: he simply couldn’t find an appropriate platform for sharing a dozen GB. Having a look at it I found single pictures with the size of 12 megapixels at ~ 6 MB. For use at the Internet and even for just having a quick print this seems to be totally exaggerated.

Scale down the images with a batch process. The way is pretty easy: on your Linux desktop or the destination server, install the command line image manipulation program imagemagick.

$ apt-get install imagemagick

Move into each single folder of your foto gallery and iterate through the list of files, resizing from 4.000 to 2.000 px while keeping the aspect ratio, recalculating the quality down to 85% and adding “web_” as a leading tag to the file names:

$ for i in *.JPG; do convert -resize 2000 -quality 85 $i web_`basename $i`; done

With this method, the source files will not be overwritten, the quality is still okay if you want to download and print this image onto a smaller format, and the files can now easily and quickly be handled (~ 550 kB).

resize images with imagemagick - file list


Leave a Reply

Your email address will not be published. Required fields are marked *