Resize multiple images in one go

Published by TheJoe on

Estimated reading time: 2 minutes


This article was published more than a year ago, there may have been developments.
Please take this into account.

Resize Images, since the photo editing programs have become part of the routine of the average, is a task as simple as trivial. It is used especially for smaller size is available save bandwidth on the transfer of the file: smaller image will load faster and also to use the images on the web is not the high resolution needed. The problem arises when we have a considerable number of images to be resized, open them one by one can become quite long and tedious.

One of the solutions is “David’s Batch Processor“, a plugin for Gimp that allows you to run some filters on multiple images, including the “Resize” to resize.

David’s Batch Processor” can be fun to discover, and can certainly speed up the work that otherwise we would hand, but compared to other programs is slow. I know the fastest way to resize multiple images in one go is the command line. ImageMagick is a small yet powerful command line tool (obtained via the web as added library to PHP). ImageMagick is a program that includes several commands, Today we see a couple.


The command “convert” converts the input image and creates a copy. Eventually we will have processing the initial image and the converted image. With “convert” you can not overwrite an image.

Now let's see how it is possible change the size of an image:

convert -geometry 1024x 1.jpg 1_mod.jpg

This command resizes the long side image “1.jpg” a 1024px, maintaining unchanged proportions.

for i in *.jpg; do convert -geometry 1024x $i thumb-$i; done

This other command performs the same work, but converts all images with estensione “.jpg” 1024px to the side.

for i in *.jpg; do convert -scale 50% $i thumb-$i; done

This other command uses the argument “scale” in place of “geometry“. The argument “scale” is used together with the percentage of reduction / magnification image. In this case the image will be halved.

convert originale.jpg originale.png

Should be noted that “convert” can also be used to change the file extension (will always create a copy without overwriting).

Look here:  The bizarre requests in the graphics industry


The command “mogrify” is virtually identical to the command “convert“, the difference is that it will not create a copy of the original, but overwrite the input image. Eye so you do not overwrite if it is not exactly what you want to do.

In a few minutes we finished to resize our images, and we did not do the job manually. A real godsend.


I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.


Francesco Paolo · 26 November 2015 at 1:47 PM

Hello I want to know how I can use the command mogrify to resize a file 800×400 a 800×800 maintaining the aspect ratio.


    TheJoe · 30 November 2015 at 10:55 AM

    I do not think you understand. Your starting image is 800×400. You will scalarne size (both), because it modifies only the aspect ratio is not respected.
    Maybe you're going to “cut off” part of the image, in this case you can cut it to 400×400 and then oversize it 800×800. Obviously you have a poor quality when done.

Leave a Reply

Avatar placeholder

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.