imagemagick

CLI

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

2 views

Installation

Homebrewbrew install imagemagick

Links

License

ImageMagick

AI Agent Notes

Batch convert, resize, and manipulate images

When to use

Image format conversion, resizing, or batch processing

Examples
  • convert input.png output.jpg
  • convert *.png -resize 50% thumbnails/

Proven Recipes

Convert PDF to image🟢 94% success
convert -density 150 input.pdf output.png
⚠ Common failures (2)
  • Blurry/low resolution output-density option is required; use -density 150 or higher before the input file
  • Policy error: not authorizedEdit /etc/ImageMagick-6/policy.xml and change PDF rights from 'none' to 'read|write'
Fallback:pdftoppm -r 150 input.pdf output
Resize image to percentage🟢 99% success
convert input.jpg -resize 50% output.jpg
Resize image to exact dimensions🟢 98% success
convert input.jpg -resize 800x600! output.jpg
⚠ Common failures (1)
  • Aspect ratio changed unexpectedlyUse 800x600 without ! to keep aspect ratio, or 800x to fix only width
Batch convert PNG to JPEG🟢 91% success
convert '*.png' -quality 85 'output_%d.jpg'
⚠ Common failures (1)
  • Only one file convertedUse mogrify instead: mogrify -format jpg -quality 85 *.png
Fallback:mogrify -format jpg -quality 85 *.png