Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A list of useful commands with ImageMagick

ImageMagick commands reference

Most basic usage (convert file type)

convert SRC DEST
convert -format FORMAT SRC DEST # explicitly define type instead of relying on extensions

Basic functions

Resize image

convert -resize 50% SRC DEST    # by percentage
convert -resize 64x64 SRC DEST  # to precise dimensions
convert -resize 64 SRC DEST     # fit to set height
convert -resize x64 SRC DEST    # fit to set width

Rotate image (by degrees)

convert -rotate -90 SRC DEST

Negate colors (invert)

convert -negate SRC DEST

Difference between two images

composite SRC1 SRC2 -compose difference DEST

Complex uses

Compress a jpg (good quality/size tradeoff)

convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% SRC DEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment