ImageMagick: Mogrify vs Convert? Which one to use and when?
Posted by Jai on October 18, 2012
ImageMagick provides the flexibility to use commands like mogrify and convert to do the same operation. Sometimes it is very hard for users to figure out which command line utility to use and in which scenario one would be better than other one.
In this post, we will have a look at some of such scenario where we will see which command will fit better than the other one.
Mogrify as stated in the documentation, is similiar to convert except that the original image file is overwritten.
Mogrify does processing on the same image, it reads file modify file and writes the output to the same file.
Convert is meant to work on separate images, reads file and modify and write to different file/format. You can also use convert command to use output file same as input file.
Mogrify is a mainly used for batch processing, which means you want to modify existing files in batch mode. The batch mode operation is much faster and same images will be modified.
Convert command provides you additional flexibility to use multiple commands in piped format. You can combine multiple convert commands in single command and can pass the output of one command as input of another command.
Mogrify is more efficient for batch processing and convert is more efficient for multiple operation and piped operations on same file.
Use each command wisely based on your requirements and see which one fits you in which scenario.