Command Line Batch Image Processing with mogrify

To process a single file you can use convert. For example, to reduce the quality of a jpg image you can run

convert -quality 75 file.jpg


mogrify -quality 75 file.jpg

However, to apply to same action to all the jpg images in a directory you have to run mogrify. This tool is similar to convert except the original image file is overwritten with any changes. Batch convertion with mogrify is quite straightforward:

mogrify -quality 75 *.jpg

If you want to run your batch operation recursively to all subdirectories you can run

find . -name '*.jpg' -execdir mogrify -quality 75 {} \;

A list of all (more than 200!) convert/imagemagick options is available at

notes/batch-image-processing.txt · Last modified: 2014/10/23 03:57 by admin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki