magick(1)
ImageMagick's primary command-line tool for reading, converting, and manipulating images in over 200 formats.
Synopsis
magick [-option value]... input [output]
magick [-option value]... input [-option value]... outputDescription
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
| Flag | What it does |
|---|---|
-resize WIDTHxHEIGHT | Scale image to specified dimensions, preserving aspect ratio by default |
-crop WIDTHxHEIGHT+X+Y | Extract a rectangular region; useful for removing unwanted edges |
-quality N | Set JPEG/WebP compression quality (1-100); default 92 for JPEG |
-rotate DEGREES | Rotate image clockwise by specified degrees; can be fractional |
-flatten | Merge all layers into a single image, removing transparency |
-strip | Remove all metadata (EXIF, color profiles, etc.) to reduce file size |
-format FORMAT | Specify output image format (jpg, png, gif, webp, etc.) |
-density DPIxDPI | Set resolution for rendering PDFs and vector formats |
-monochrome | Convert to black and white, using only two colors |
-blur RADIUSxSIGMA | Apply Gaussian blur with given radius and standard deviation |
-brightness-contrast B×C | Adjust brightness and contrast levels |
-colorspace COLORSPACE | Convert between color spaces (RGB, sRGB, Gray, CMYK, etc.) |
Examples
Convert PNG to JPEG format
magick input.png output.jpgResize image to 800×600 and compress with 85% quality
magick input.jpg -resize 800x600 -quality 85 output.jpgCrop a 200×200 pixel region starting at position (50,50)
magick input.png -crop 200x200+50+50 output.pngRotate 90 degrees clockwise and remove metadata
magick input.jpg -rotate 90 -strip output.jpgConvert PDF to PNG images at 150 DPI, creating page-0.png, page-1.png, etc.
magick -density 150x150 input.pdf page-%d.pngApply slight blur and increase brightness and contrast
magick input.jpg -blur 0x2 -brightness-contrast 10x5 output.jpgStack two images vertically; use +append for horizontal
magick image1.jpg image2.jpg -append combined.jpgBatch process all JPEGs, resizing and creating numbered thumbnails
magick '*.jpg' -resize 1024x768 -format jpg -quality 80 'thumb-%d.jpg'