$linuxjunkies
>

magick(1)

ImageMagick's primary command-line tool for reading, converting, and manipulating images in over 200 formats.

UbuntuDebianFedoraArch

Synopsis

magick [-option value]... input [output]
magick [-option value]... input [-option value]... output

Description

ImageMagick's magick command (formerly convert) is a powerful utility for image manipulation. It reads images in various formats, applies transformations, and writes the result to a new file or standard output. A single command can process multiple images, apply effects, and combine images in sophisticated ways.

The command operates left-to-right through the argument list. Options before the first input filename apply globally; options between filenames apply to that specific image. Use parentheses to group operations on subsets of images.

Common options

FlagWhat it does
-resize WIDTHxHEIGHTScale image to specified dimensions, preserving aspect ratio by default
-crop WIDTHxHEIGHT+X+YExtract a rectangular region; useful for removing unwanted edges
-quality NSet JPEG/WebP compression quality (1-100); default 92 for JPEG
-rotate DEGREESRotate image clockwise by specified degrees; can be fractional
-flattenMerge all layers into a single image, removing transparency
-stripRemove all metadata (EXIF, color profiles, etc.) to reduce file size
-format FORMATSpecify output image format (jpg, png, gif, webp, etc.)
-density DPIxDPISet resolution for rendering PDFs and vector formats
-monochromeConvert to black and white, using only two colors
-blur RADIUSxSIGMAApply Gaussian blur with given radius and standard deviation
-brightness-contrast B×CAdjust brightness and contrast levels
-colorspace COLORSPACEConvert between color spaces (RGB, sRGB, Gray, CMYK, etc.)

Examples

Convert PNG to JPEG format

magick input.png output.jpg

Resize image to 800×600 and compress with 85% quality

magick input.jpg -resize 800x600 -quality 85 output.jpg

Crop a 200×200 pixel region starting at position (50,50)

magick input.png -crop 200x200+50+50 output.png

Rotate 90 degrees clockwise and remove metadata

magick input.jpg -rotate 90 -strip output.jpg

Convert PDF to PNG images at 150 DPI, creating page-0.png, page-1.png, etc.

magick -density 150x150 input.pdf page-%d.png

Apply slight blur and increase brightness and contrast

magick input.jpg -blur 0x2 -brightness-contrast 10x5 output.jpg

Stack two images vertically; use +append for horizontal

magick image1.jpg image2.jpg -append combined.jpg

Batch process all JPEGs, resizing and creating numbered thumbnails

magick '*.jpg' -resize 1024x768 -format jpg -quality 80 'thumb-%d.jpg'