convert and mogrify: The correct way to use them in modern versions of ImageMagick

AFAIK, and I am happy to add any corrections suggested, it works like this.

The first idea is that you should use version 7 if possible and all the old v6 commands, WITH THE EXCEPTION OF convert should be prefixed with magick. That means you should use these

magick ...                # in place of `convert`
magick identify ...       # in place of `identify`
magick mogrify ...        # in place of `mogrify`
magick compare ...        # in place of `compare`
magick compose ...        # in place of `compose`

If you use magick convert you will get old v6 behaviour, so you want to avoid that!

Furthermore, v7 is more picky about the ordering. You must specify the image you want something done to before doing it. That means old v6 commands like:

convert -trim -resize 80% input.jpg output.jpg

must now become:

magick input.jpg -trim -resize 80% output.jpg     # magick INPUT operations OUTPUT

So, looking specifically at your numbered examples:

  1. Should become:

    magick image.jpg -thumbnail 100x100 ./converted/converted_image.jpg

  2. Should become:

    magick mogrify -thumbnail 100x100 -path ./converted image.png

  3. invokes old v6 behaviour because you use magick convert instead of plain magick, and should be avoided

  4. Is correct, modern syntax

  5. Is correct, modern syntax

  6. Looks like you meant magick mogrify because you didn’t give input and output filenames and because you use -path, but it looks like you accidentally omitted mogrify. If you didn’t accidentally omit mogrify, then you probably meant to use the old convert-style command, and need an input and an output file and you need to specify the input file before the -thumbnail.

Keywords: Usage, wrong, modern, v7 syntax, prime.

Leave a Comment