Batch resize images with mogrify from the command line


If you need to resize a lot of images, doing it manually in Gimp is an option, but can take a long time.

In stead, you could do it from the command line, with the mogrify tool, which is included in imagemagick.

Install it like this:

$ sudo apt install imagemagick

Use it like this, which creates a folder for the smaller files, and then resize all PNG images to a maximum width of 700 pixels, putting the resulting smaller files in the path/to/image/folder/resized folder:

$ cd path/to/image/folder
$ mkdir resized
$ mogrify -path resized -resize 700 *.png;

This finds all PNG files and converts them to JPG format, recursively in all subfolders:

$ find -name "*.png" -exec mogrify -resize 600 -quality 75 -format jpg {} \;