Commands
magick
Convert and manipulate images with ImageMagick — including favicon generation, format conversion, resizing, and compression.
ImageMagick Cheatsheet
ImageMagick is a command-line tool for converting, resizing, and optimizing images.
Here are some of the most useful one-liners for everyday web and design tasks.
Generate a Multi-Size Favicon
Convert a single logo file into a .ico with multiple resolutions for browser compatibility.
magick logo.png -define icon:auto-resize=16,32,48,64,128,256 favicon.icoConvert Between Formats
Convert images between formats (e.g., PNG → JPG or WEBP → PNG).
magick input.png output.jpg
magick input.webp output.pngResize Images
Resize while keeping aspect ratio:
magick input.png -resize 512x512 output.pngForce an exact size (ignore aspect ratio):
magick input.png -resize 512x512\! output.pngOptimize and Compress
Strip metadata and reduce file size for web:
magick input.png -strip -quality 85 output.jpgConvert and compress to WebP:
magick input.png -strip -quality 80 output.webp