Dissecting the ImageMagick 7 architecture: a single magick command that replaces convert, mogrify, identify, compare, montage, stream, animate, and display, the roles of MagickCore and MagickWand, the coder module for each format, delegates, up to the pixel model with quantum depth, colorspace, alpha, and image lists.

After understanding ImageMagick's history in episode 1 — born in 1990, the two generations of IM6 and IM7 — now it's time to dissect how ImageMagick works from the inside. This episode is the bridge between "why ImageMagick exists" and "how to use it", so pay close attention to the flow.
Many people use ImageMagick like a photocopier: give it a file name, wait for the result. Yet behind a single line magick sample.png output.jpg there is a well-ordered, layered architecture. Understanding these layers — like opening the hood before driving — will make you far more confident when the result doesn't match expectations.
magickThe most important design decision in ImageMagick 7 is the unified command: a single magick binary that holds all functionality. The old IM6 commands are now subcommands:
| IM6 command (legacy) | IM7 subcommand | Purpose |
|---|---|---|
| convert | magick | Conversion, resize, effects, compositing |
| mogrify | magick mogrify | Batch in-place editing of many files |
| identify | magick identify | Read image information |
| compare | magick compare | Compare two images |
| montage | magick montage | Combine many images on one canvas |
| stream | magick stream | Extract raw pixel data |
| animate | magick animate | Play a sequence of images as animation |
| display | magick display | Display an image interactively |
The consequence is pleasant: you don't have to memorize eight different binaries. Understand one pattern — magick [subcommand] [input] [options] [output] — and the rest is just subcommand details. In the following episodes we'll spend a lot of time with the identify subcommand and the magick input -options output pattern.
Behind the magick command there are three main layers:
| Layer | Role | Analogy |
|---|---|---|
CLI (magick) | Command line interface | Control panel |
| MagickWand | High-level C API | The main engine called by the panel |
| MagickCore | Low-level core library | The engine's components |
MagickCore is the foundation: a C library that handles in-memory image representation, pixel allocation, and core operations. MagickWand is built on top of MagickCore with a more developer-friendly API, and it becomes the basis for libraries in other languages — there are official bindings for Perl, Python, Ruby, and PHP, as well as projects like imagemagick for Node.js and Go.
Tip
You don't have to become a C developer to master this series. But remember this map: when you later use ImageMagick through a framework or library (for example MiniMagick in Rails), you're actually talking to the MagickWand layer — while the CLI series we're learning talks to the CLI layer on top of it.
How can ImageMagick touch 200+ formats? The answer: each format is handled by a dedicated module called a coder. PNG is handled by the png coder, JPEG by the jpeg coder, WebP by webp, and so on.
magick -list formatThe output is long — each line is one format with its coder, read/write mode, and description. This pattern explains why ImageMagick can be consistent: in memory, all formats are processed as the same pixel model, and the only difference is the coder responsible for packing and unpacking the data.
Not all formats are implemented directly by ImageMagick. For complex formats, ImageMagick borrows external tools through the delegate mechanism:
| Delegate | Formats Handled |
|---|---|
| Ghostscript | PostScript and PDF |
| LibreOffice | ODF, DOCX, and similar documents |
| ffmpeg | Video |
| librsvg | SVG (if compiled in) |
Check the delegate list on your machine:
magick -list delegateThis is why the magick --version output we saw in episode 0 lists the built-in delegates: the more complete the delegates, the more formats ImageMagick can handle. For example, without Ghostscript, ImageMagick cannot read PDF.
The core of understanding ImageMagick lies here: any image, in any format, is always represented in memory as the same pixel model. Four concepts make up this model:
Quantum depth determines the precision of each pixel channel — this is the same as the Q8, Q16, and Q16-HDRI build variants we discussed in episode 0. A Q16 build processes each channel with 16 bits (0-65535), while Q16-HDRI uses floats so it can represent values beyond the 0-100% range for HDR needs.
Colorspace is the way color is represented: sRGB (web standard, default), CMYK (printing world), XYZ, HSL, and others. Converting between colorspaces is a mathematical operation applied to each pixel — we'll practice it in episode 5.
Image: sample.png
Format: PNG (Portable Network Graphics)
Geometry: 640x480
Colorspace: sRGB
Type: TrueColorAlpha
Depth: 16/8-bitThe alpha channel is the per-pixel transparency channel — a value of 0 means fully transparent, the maximum value means opaque. Many formats (PNG, WebP) support alpha; JPEG does not. This is why converting a transparent PNG to JPEG can produce unwanted black or white areas — a topic we'll resolve in episode 3.
One image object in ImageMagick can actually hold multiple frames at once — called an image list. Animated GIF files, multipage TIFFs, and multi-page PDFs are all read as an image list containing several images:
magick identify animated.gif
magick identify multi-page.pdfThis image list concept is the foundation for the episodes about animation, multi-frame, and montage in this series. Many ImageMagick operations apply "to the whole list" — one command, many frames.
In this episode 2, you've dissected the ImageMagick architecture from the inside: a single magick command that replaces eight legacy commands, three architecture layers (CLI, MagickWand, MagickCore), the coder module for each format, the delegate mechanism, and the pixel model with quantum depth, colorspace, alpha channel, and image lists.
The key takeaways:
magick is one command for everything — its subcommands replace convert, mogrify, identify, compare, montage, stream, animate, and display.In the next episode 3, we start real hands-on work: basic format conversion — converting PNG to JPEG, rasterizing SVG to PNG, understanding JPEG quality and compression, PNG optimization, WebP, AVIF, and JXL output, and verifying results with magick identify. See you in episode 3!