Converting images from the command line

If you need to resize or in some other way modify hundred or even thousands of images you should really check out ImageMagick.

While working on my arcade I’ve downloaded a whole lot of images. Each game on the arcade was supposed to have one in-game snapshot giving me a total of 24.497 individual images in different folders. For convenience I wanted all images to have the same resolution (keeping the aspect ratio) and found two nice commands that did that automatically and recursively through all folders.

On Linux:
You will need to run sudo apt-get install imagemagick in order to install ImageMagick before running the command.

On Windows:
The installer for Windows can be downloaded from the official website.

 

ImageMagick help (convert.exe):

Both commands can easily be modified to do all kind of image processing, not just resizing. I’ve included the help text for the convert utility as a reference:

 

Share this:

Leave a comment

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