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.Documentation Index
Fetch the complete documentation index at: https://hackmamba-3f164318.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Install ImageMagick
- macOS
- Linux
- Windows
- Docker
Verify the installation
Run:What “success” looks like: the first line must report ImageMagick 7 (not How to read itYou should see at least one line with
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):- 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.
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).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.
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.Inspect an image
Use Output:Reading left to right: filename, format, dimensions, geometry, bit depth, colorspace, file size.For a cleaner view, use Output:
magick identify to check an image’s format, dimensions, and file size without opening it:-format to pick the fields you want: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 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.
-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:Keep going
You can now install, convert, resize, inspect, and batch-process images. Paths forward depend on what you need:- Build an image processing pipeline walks you through combining resize, metadata stripping, watermarking, and format conversion into a reusable workflow.
- Batch resize and optimize for web covers real-world batch processing with quality control and file size constraints.
- Geometry syntax reference explains the modifiers (
>,<,!,^) you can append to dimension strings. - Common options reference documents
-strip,-quality,-auto-orient,-gravity,-background, and-compositein one place. - Troubleshooting if install or first commands fail (
magicknot found, missing delegates, policy errors, or shell escaping around>in geometry).