Skip to content
CLI tool · Media

ImageMagick for AI agents

ImageMagick for coding agents: identify images, resize and convert formats, strip metadata, and batch-make thumbnails without overwriting the originals.

magickby ImageMagick Studio
What it is

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

Install ImageMagick

The install commands from the official docs. Check it worked with magick -version.

Homebrew
brew install imagemagick
Debian or Ubuntu (may install version 6)
sudo apt-get install imagemagick
Auth

Signing in ImageMagick for an agent

No sign-in. ImageMagick works on local files.

Common agent tasks

What agents use ImageMagick for

Example commands with placeholder names. Swap in your own project, app, or file names.

  1. Show an image's format and size

    magick
    magick identify photo.jpg
  2. Resize to 800 pixels wide

    magick
    magick input.png -resize 800x output.png
  3. Convert to WebP

    magick
    magick input.png -quality 82 output.webp
  4. Strip EXIF and other metadata

    magick
    magick input.jpg -strip clean.jpg
  5. Make thumbnails into a separate folder

    magick
    mkdir -p thumbs && magick mogrify -path thumbs -resize 256x256 -format jpg *.png
Safety

Safety rules for agents

Safe to run without asking

  • magick identify
  • magick 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.
Agent instructions

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.

AGENTS.md
## 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.
CLI or MCP server?

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.

Same category
All Media tools
FAQ

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.