Skip to content

Instantly share code, notes, and snippets.

@haruaki64
Last active November 30, 2016 06:34
Show Gist options
  • Save haruaki64/51b65b2100feb38e363bc418d48da005 to your computer and use it in GitHub Desktop.
Save haruaki64/51b65b2100feb38e363bc418d48da005 to your computer and use it in GitHub Desktop.
ImageMagickを使って、保存されている画像を正方形(500x500)にクロップ
# source: 元画像のパス
# dest: 変更された画像のパス
# sourceとdestは一緒でも大丈夫(上書きされる)
# たぶんsourceとdestで拡張子違っても大丈夫
$ convert -resize 500x500^ -gravity center -crop 500x500+0+0 +repage source dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment