imagemagick
CLICreate, edit, and convert images from the command line.
Batch convert, resize, and manipulate images. brew = ImageMagick 7 (magick), apt = ImageMagick 6 (convert)
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
magick -density 150 input.pdf output.pngCommon 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
pdftoppm -r 150 -png input.pdf outputResize image by percentage (ImageMagick 7, macOS)
macOS only
magick input.png -resize 50% output.pngResize image to exact dimensions (ImageMagick 7, macOS)
macOS only
magick input.png -resize 80x40! output.pngCommon 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
magick input.png output.jpgBatch convert PNG to JPEG (ImageMagick 7, macOS)
macOS only
magick mogrify -format jpg -quality 85 *.pngRead image dimensions (ImageMagick 7, macOS)
macOS only
magick identify -format '%wx%h\n' input.pngResize image by percentage (ImageMagick 6, Linux apt)
Linux only
convert input.png -resize 50% output.pngCommon 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
convert input.png -resize 80x40! output.pngConvert image format (ImageMagick 6, Linux apt)
Linux only
convert input.png output.jpgBatch convert PNG to JPEG (ImageMagick 6, Linux apt)
Linux only
mogrify -format jpg -quality 85 *.pngRead image dimensions (ImageMagick 6, Linux apt)
Linux only
identify -format '%wx%h\n' input.pngInstall
brew install imagemagicksudo apt install imagemagickAgent 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.jpgconvert 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.