utils
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.

Generate favicon.ico
magick logo.png -define icon:auto-resize=16,32,48,64,128,256 favicon.ico

Convert Between Formats

Convert images between formats (e.g., PNG → JPG or WEBP → PNG).

magick input.png output.jpg
magick input.webp output.png

Resize Images

Resize while keeping aspect ratio:

magick input.png -resize 512x512 output.png

Force an exact size (ignore aspect ratio):

magick input.png -resize 512x512\! output.png

Optimize and Compress

Strip metadata and reduce file size for web:

magick input.png -strip -quality 85 output.jpg

Convert and compress to WebP:

magick input.png -strip -quality 80 output.webp