Skip to content

Instantly share code, notes, and snippets.

@abelcallejo
Last active June 15, 2021 01:01
Show Gist options
  • Save abelcallejo/26782d313590d40a0a9b97f6027a2027 to your computer and use it in GitHub Desktop.
Save abelcallejo/26782d313590d40a0a9b97f6027a2027 to your computer and use it in GitHub Desktop.
ImageMagick Cheatsheet

ImageMagick Cheatsheet

Wizard performing magic with the Monalisa painting

Recoloring

convert grey.png -fill "#d7ccc8" -tint 100 brown.png
# or
convert grey.png -fill chocolate -tint 50 brown.png

Sharpening

convert smooth.png -sharpen 3 sharpened.png

Resizing to fixed width

Width is fixed to 1920 and the height is relative

convert input.jpg -auto-orient -resize 1920x output.jpg

Resizing to thumbnail

Cropping is based from the center

convert input.jpg -auto-orient -thumbnail 100x100^ -gravity center -extent 100x100  output.jpg

Rotating images

convert input.jpg -rotate 180 output.jpg

180 is the value in degrees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment