LoginSignup
35
28

More than 3 years have passed since last update.

imagemagickで画像のリサイズ

Last updated at Posted at 2018-07-12

imagemagickで画像のリサイズを行う時、

1ファイルずつ

1ファイルずつ
# 縦横比を維持したままリサイズ。指定サイズ内に収まるように縮める
convert -resize 1366x768 input.png output.png

# 縦横比を無視して強制リサイズ
convert -resize 1366x768! input.png output.png

複数画像

複数画像を一斉にリサイズ
# 縦横比を維持したままリサイズ。指定サイズ内に収まるように縮める
mogrify -resize 1366x768 *.png

# 縦横比を無視して強制リサイズ
mogrify -resize 1366x768! *.png

.psdをpng化

合成レイヤーのみ
convert input.psd[0] output.png

圧縮

リサイズをした後、ファイルサイズが大きいため、以下オンラインサービスで縮小すると良い。
https://imagecompressor.com/ja/

35
28
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
35
28