Created
March 25, 2015 06:57
-
-
Save Rudis1261/ac876de36652d6961ecf to your computer and use it in GitHub Desktop.
Center Cropping images with ImageMagick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Creating thumbnail of ${1}, to ${2}" | |
echo "Dimensions: ${3}px X ${4}px" | |
convert $1 -format png -strip -resize $3'x'$4'^' -gravity center -crop $3x$4'+0+0' $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting it
Usage
Examples
Will create a cropped image with the dimensions of 180px wide by 265px high.
Will create a cropped square image with the dimensions of 150px wide by 150px high.