The ImageMagick command-line tools can range from simple single-file conversions:
Or scale into complex multi-step processing pipelines with a plethora of options:
\( +clone -shade 110x90 -normalize -negate +clone -compose Plus -composite \) \
\( -clone 0 -shade 110x50 -normalize -channel BG -fx 0 +channel -alpha Off \) \
-delete 0 +swap -compose Multiply -composite button.gif
\) for line continuation, whereas Windows uses a caret (^). Parentheses do not require escaping under Windows.
Dynamic Shaded Progress Cylinder
Generate complex vector-like primitives, gradients, shadows, and labels programmatically.
The Anatomy of the Command-line
An ImageMagick command string consists of the following modular building blocks:
- One or more required input filenames.
- Zero, one, or more persistent image settings.
- Zero, one, or more immediate image operators.
- Zero, one, or more image sequence operators.
- Zero, one, or more isolated image stacks (parentheses).
- Zero or one output image filename.
Input Filename Extensions
ImageMagick extends input filenames far beyond simple file paths to support globbing, built-ins, and direct streams.
Filename Globbing
Wildcards like asterisks automatically match sets of files across all platforms (e.g., Windows and Linux):
Explicit Image Format
Force signature-less raw data streams by prefixing formats explicitly:
Built-in Images & Patterns
Generate standard procedural patterns instantly:
STDIN / STDOUT Pipes
Stream image pipelines seamlessly between processes using -:
Command-line Options & Settings
Options dictate execution behavior and are categorized into persistent settings, immediate operators, sequence operators, and geometry modifiers.
Image Settings (Persistent)
Persist across the command line until execution terminates or settings are overridden:
Image Geometry Reference
Geometry arguments control target widths, heights, percentages, and coordinate offsets without spaces.
| Size / Modifier | Description & Behavior |
|---|---|
| scale% | Height and width both scaled by specified percentage. |
| widthxheight | Maximum values of height and width given; aspect ratio preserved. |
| widthxheight^ | Minimum values of width and height given; aspect ratio preserved. |
| widthxheight! | Width and height strictly forced; original aspect ratio ignored. |
| widthxheight> | Shrink image only if dimensions are larger than specified bounds. |
| widthxheight< | Enlarge image only if dimensions are smaller than specified bounds. |
| area@ | Resize image to total pixel area limit while preserving aspect ratio. |
| size+x+y | Pixel offset coordinates adjusted by gravity rules. |
Image Stack & Output Management
Isolate operations using parenthesis blocks and export results using advanced formatting strings.
Isolated Stack Processing Example
Apply rotation strictly inside a parentheses stack without affecting preceding files:
Sequential Output Formatting
Extract property strings or format multi-page sequence outputs dynamically:

