Skip to content

Instantly share code, notes, and snippets.

@hparra
Last active December 24, 2015 22:49
Show Gist options
  • Select an option

  • Save hparra/6875934 to your computer and use it in GitHub Desktop.

Select an option

Save hparra/6875934 to your computer and use it in GitHub Desktop.
Tips for producing web images with ImageMagick

Resize

convert -resize 75% <2x source> <1.5x destination>
convert -resize 50% <2x source> <1x destination>

Add Padding

convert -gravity center -background transparent -extent <geometry> <source> <destination-optional>

Resize so largest dimesion is 256px and fill other dimension with padding til 256px

convert -gravity center -background transparent -resize 256x256 -extent 256x256 <source> <destination-optional>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment