ImageMagick for AI agents
ImageMagick for coding agents: identify images, resize and convert formats, strip metadata, and batch-make thumbnails without overwriting the originals.
What ImageMagick does for an agent
ImageMagick is a long-standing open-source suite for creating, editing, and converting images in hundreds of formats. In version 7 every operation runs through the magick command.
Older version 6 releases, still common in Linux distributions, use separate commands such as convert and identify. Check which one is installed before writing commands.
Official site: imagemagick.org
Install ImageMagick
The install commands from the official docs. Check it worked with magick -version.
brew install imagemagick
sudo apt-get install imagemagick
Signing in ImageMagick for an agent
No sign-in. ImageMagick works on local files.
What agents use ImageMagick for
Example commands with placeholder names. Swap in your own project, app, or file names.
Show an image's format and size
magick identify photo.jpg
Resize to 800 pixels wide
magick input.png -resize 800x output.png
Convert to WebP
magick input.png -quality 82 output.webp
Strip EXIF and other metadata
magick input.jpg -strip clean.jpg
Make thumbnails into a separate folder
mkdir -p thumbs && magick mogrify -path thumbs -resize 256x256 -format jpg *.png
Safety rules for agents
Safe to run without asking
magick identifymagick input ... new-output-file
Ask a human first
magick mogrify without -path (edits files in place)batch jobs over directories the user did not name
- mogrify overwrites files in place; always pass -path to write to a separate folder.
- Write results to new file names and leave originals untouched.
- Be careful with untrusted input files; keep ImageMagick updated and its security policy in place.
AGENTS.md or CLAUDE.md snippet
Paste this into the instruction file your agent reads at the start of every session, then adjust the rules to your setup.
## ImageMagick (magick) Use `magick` for inspecting, resizing, converting, and batch-processing images. - Check it is installed with `magick -version`. If it is missing, ask before installing it. - Auth: none needed. - Run without asking (read-only): `magick identify`, `magick input ... new-output-file`. - Ask a human first (changes or deletes things): `magick mogrify without -path (edits files in place)`, `batch jobs over directories the user did not name`. - mogrify overwrites files in place; always pass -path to write to a separate folder. - Write results to new file names and leave originals untouched. - Be careful with untrusted input files; keep ImageMagick updated and its security policy in place. - Prefer JSON output where the command supports it, and keep output short.
ImageMagick or an MCP server?
No official MCP server. ImageMagick has no official MCP server. Agents with a shell run magick directly; search the directory for image-processing servers for chat clients.
Rule of thumb: in a terminal agent that a human has signed in, the CLI is usually faster and cheaper in context. In a chat client without a shell, or when you want a fixed set of typed tools, use an MCP server.
Other Media tools
ImageMagick questions
How do I install ImageMagick?
Homebrew: brew install imagemagick. Other official options: Debian or Ubuntu (may install version 6). Check the install with magick -version, and see the ImageMagick Studio docs for other platforms.
How does an AI agent authenticate ImageMagick?
No sign-in. ImageMagick works on local files. There is nothing to set up: an agent can use it as soon as magick -version succeeds.
Which ImageMagick commands are safe for an agent to run?
Commands that only read state are safe to run without asking: magick identify; magick input ... new-output-file. Ask a human before anything that changes or deletes something: magick mogrify without -path (edits files in place); batch jobs over directories the user did not name.
Is there an MCP server for ImageMagick?
ImageMagick has no official MCP server. Agents with a shell run magick directly; search the directory for image-processing servers for chat clients.