Skip to content

Instantly share code, notes, and snippets.

@AkiyukiOkayasu
Last active April 14, 2024 01:52
Show Gist options
  • Save AkiyukiOkayasu/1373ebab29965c1312d8cbc11317b4ca to your computer and use it in GitHub Desktop.
Save AkiyukiOkayasu/1373ebab29965c1312d8cbc11317b4ca to your computer and use it in GitHub Desktop.
ImageMagickで画像(JPG, PNG)を1:1にリサイズ、余白追加
# 余白を短辺にのみ設ける場合
magick mogrify -filter Lanczos -distort Resize 1280x1280 -extent 1280x1280 -gravity center -background white -path converted *.jpg *.png
# 上下左右に少なくとも30pxの余白を設ける場合
magick mogrify -filter Lanczos -distort Resize 1000x1000 -extent 1060x1060 -gravity center -background white -path converted *.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment