Skip to main content
New to ImageMagick? This page takes you from installation to your first working commands. If you already have it installed, skip to the tutorial or how-to guides.

Install ImageMagick

Install with Homebrew:
Homebrew bundles ImageMagick with delegates for JPEG, PNG, WebP, TIFF, and other common formats. For Ghostscript font support, also run:
MacPorts (sudo port install ImageMagick) is an alternative if you prefer it.
1

Verify the installation

Run:
What “success” looks like: the first line must report ImageMagick 7 (not 6.9.x). You should also see a Delegates line listing codecs compiled into this binary.Example (yours will differ slightly by version, CPU, and HDRI):
How to read it
  • Delegates (built-in): space-separated names (jpeg, png, webp, tiff, …) tell you which formats this build can handle without extra plug-ins. If the format you need never appears here, this binary cannot decode/encode it; you need a different install (another AppImage, Homebrew build, Docker image, or a custom compile with the right libraries).
  • If webp (or HEIC, AVIF, etc.) is missing but you need it, switch to a fuller build or follow your OS packager’s docs to add libraries and reinstall ImageMagick.
Spot-check a single format:
You should see at least one line with WEBP and read/write flags (rw* or r-- for read-only). On Windows PowerShell, use magick -list format | Select-String -Pattern webp.
Operators vs. settings (read this once). Flags fall into two groups. Operators (-resize, -crop, -rotate, …) transform the image at the point they appear in the command line. Settings (-gravity, -quality, …) change state for the rest of the command until you override them; for example -gravity Center affects every later spatial operator, and -quality 80 sets the JPEG/WebP compression used when the output file is written (moving -quality earlier vs. later in the command usually does not change the result).
2

Convert between formats

Convert a JPEG file to PNG:
ImageMagick determines both input and output formats from the file extension. That single command decodes the JPEG, then re-encodes it as PNG.
3

Resize an image

Shrink an image to fit within 800x600 pixels:
The -resize operation preserves the original aspect ratio. A 1600x1200 input becomes 800x600. A 2000x1500 input becomes 800x600. A 1200x800 input becomes 800x533, because 800 is the limiting dimension at the 3:2 aspect ratio.
Add > after the dimensions to skip images that are already small enough: magick input.jpg -resize 800x600\> output-small.jpg. Without the >, a 400x300 image would be enlarged to 800x600. With it, the image stays untouched.
4

Inspect an image

Use magick identify to check an image’s format, dimensions, and file size without opening it:
Output:
Reading left to right: filename, format, dimensions, geometry, bit depth, colorspace, file size.For a cleaner view, use -format to pick the fields you want:
Output:
5

Resize and compress in one command

Operations are processed left to right. You can stack several in one command:
This resizes the image, then writes it as a JPEG. The -quality number controls lossy compression for the next write (lower means smaller files and usually more visible artifacts). See -quality for how to pick values across JPEG and WebP.The order of operators matters. -resize followed by -crop produces a different result than -crop followed by -resize:
The first command shrinks the whole image, then extracts a piece. The second command extracts a piece first, then enlarges that piece. Different order, different output.
6

Process multiple files at once

magick mogrify overwrites matching inputs in place unless you send outputs elsewhere with -path (and usually -format). Create the destination folder first, then run mogrify, or use a shell loop with explicit output paths if you want per-file control (see the batch resize guide).
Use magick mogrify to apply the same operation to every file matching a pattern:
Safe pattern (writes into resized/ instead of overwriting sources):

Keep going

You can now install, convert, resize, inspect, and batch-process images. Paths forward depend on what you need: