imagemagick

CLI

Create, edit, and convert images from the command line.

Batch convert, resize, and manipulate images. brew = ImageMagick 7 (magick), apt = ImageMagick 6 (convert)

11 of 11 recipes verified by execution · 2026-09-17#image#convert#resize#png#jpg

Verified commands

Executed by our harness on the platforms shown; the assertion checked the actual result, not just the exit code.

Convert PDF to PNG (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick -density 150 input.pdf output.png
Common failures (3)
  • Blurry/low resolution output-density must come before the input file; 150 or higher
  • attempt to perform an operation not allowed by the security policy 'PDF' (Linux apt ImageMagick 6)Debian/Ubuntu block PDF in /etc/ImageMagick-6/policy.xml. Use pdftoppm -r 150 -png input.pdf output instead (poppler-utils), or change the PDF policy rights to read|write
  • multi-page PDF produces only one fileuse output-%d.png as the output name to get one PNG per page
Fallbackpdftoppm -r 150 -png input.pdf output

Resize image by percentage (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick input.png -resize 50% output.png

Resize image to exact dimensions (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick input.png -resize 80x40! output.png
Common failures (1)
  • Aspect ratio changed unexpectedlydrop the ! to keep aspect ratio (fits inside 80x40), or use 80x to fix only the width

Convert image format (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick input.png output.jpg

Batch convert PNG to JPEG (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick mogrify -format jpg -quality 85 *.png

Read image dimensions (ImageMagick 7, macOS)

macOS only

Verified macOS · 2026-09-17
magick identify -format '%wx%h\n' input.png

Resize image by percentage (ImageMagick 6, Linux apt)

Linux only

Verified Linux · 2026-09-17
convert input.png -resize 50% output.png
Common failures (1)
  • magick: command not foundDebian/Ubuntu apt ships ImageMagick 6: the binary is convert (and mogrify, identify), not magick

Resize image to exact dimensions (ImageMagick 6, Linux apt)

Linux only

Verified Linux · 2026-09-17
convert input.png -resize 80x40! output.png

Convert image format (ImageMagick 6, Linux apt)

Linux only

Verified Linux · 2026-09-17
convert input.png output.jpg

Batch convert PNG to JPEG (ImageMagick 6, Linux apt)

Linux only

Verified Linux · 2026-09-17
mogrify -format jpg -quality 85 *.png

Read image dimensions (ImageMagick 6, Linux apt)

Linux only

Verified Linux · 2026-09-17
identify -format '%wx%h\n' input.png

Install

Homebrewbrew install imagemagick
aptsudo apt install imagemagick

Agent notes

When to use
Image format conversion, resizing, or batch processing. For PDF → image prefer poppler's pdftoppm: it needs no policy change
Quick examples
  • magick input.png output.jpg
  • convert input.png -resize 50% out.png

Use from an agent

curl -s https://clihub.com/api/tools/imagemagick | jq '.agentHints.provenRecipes[] | {task, command, verified}'

Or call get_tool with slug imagemagick on the MCP server at https://clihub.com/mcp.

Homepage ↗Repository ↗ImageMagick0 views