Mogrify – How to resize images from the command line

In Linux, if you have installed ImageMagick suite, you can use a nifty command to resize images, photos or pictures. The name of the command line tool is mogrify. Here is how it is done.

Suppose you want to resize all your images to a size of 800×600.

You open a terminal and navigate to the directory containing your images, photos or pictures.

Create a directory in the location named “resized-pictures” as follows :

$ mkdir resized-pictures

Now run the mogrify command from the same location.

$ mogrify -path ./resized-pictures/ -resize 800x600 *.jpg

The above command will resize all the jpeg pictures in the current directory to a 800×600 size and save the output to the resized-pictures/ directory leaving the original pictures  intact.

Note: You can also run the mogrify command without the -path option; in which case, all the images will be resized and overwritten in the current directory itself.

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related posts: