ImageMagick Command-line suite for creating, converting, and editing raster images

Command Reference

A quick-lookup cheat sheet. See the linked page for each section for full explanations and examples.

Setup

CommandDescription
magick -versionPrint version and build info
magick identify <file>Print format, size, depth, colorspace
magick identify -verbose <file>Full metadata dump

Resizing

FlagDescription
-resize 50%Scale by percentage
-resize 800x600Fit within box, keep aspect ratio
-resize 800x600!Force exact size, ignore aspect ratio
-resize 800x600^Fill box, may overflow one side
-resize 800x600>Only shrink, never enlarge
-thumbnail 200x200Faster resize for thumbnails (strips profiles)

Cropping & Orientation

FlagDescription
-crop WxH+X+YCrop a region at offset X,Y
-gravity <dir>Set anchor: center, north, southeast, ...
-rotate <deg>Rotate clockwise (negative = counter-clockwise)
-flip / -flopVertical / horizontal flip
-auto-orientApply and clear EXIF orientation

Format & Quality

FlagDescription
-quality NLossy compression quality, 0-100
-stripRemove EXIF/ICC/XMP metadata
-define jpeg:extent=200KBTarget an approximate output file size
-colorspace sRGBConvert colorspace
-depth 8Set bit depth per channel

Compositing & Text

Flag / commandDescription
magick compositeOverlay one image on another
-compositeSame, as a chained operator
-annotate +X+Y "text"Draw text at an offset
-pointsize NSet font size for annotation
-fill <color>Set fill color for text/shapes

Batch & Layout

CommandDescription
magick mogrify [opts] *.jpgApply an operation to many files in place
magick mogrify -path out/ ...Write batch output to a separate folder
magick mogrify -format webp ...Batch-convert format, keep originals
magick montage ... -tile 4xArrange images into a contact-sheet grid

Color & effects

FlagDescription
-grayscale Rec709LumaConvert to grayscale
-blur 0x8Gaussian blur (radiusxsigma)
-sharpen 0x1Sharpen
-brightness-contrast 10x5Adjust brightness/contrast
-modulate 100,150,100Adjust brightness,saturation,hue