Last active
February 22, 2021 05:33
-
-
Save ReidWilliams/53845baae2d2d2cc5fe49ca2d7c90b8a to your computer and use it in GitHub Desktop.
resize crop 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
# resize all files in directory <in> so that the shorter dimension (or both dims) is 64 pixels, then | |
# crop the longer dimension to 64 pixels. | |
magick convert in/* -resize 64x64^ -gravity center -extent 64x64 'out/%06d.jpg' | |
# crop images using find / exec. Find / exec is useful when there are many images and file globs don't work. | |
# Crop to 1150 by 512 at the top, left edge of the image | |
find ./*.jpg -exec magick convert {} -crop 1150x512+0+0 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment