0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ImageMagickで最小サイズを指定してサイズ変換する

Last updated at Posted at 2013-03-22

imagemagickで画像のサイズ変換は以下のようにします

convert -geometry 100x200 input.png output.png

この場合、input.pngのアスペクト比と100x200のアスペクト比が異なる場合、
アスペクト比が固定される。

たとえば、input.pngが500x500pxだとする。そうするとoutput.pngは100x100
として出力される。
つまり、最大サイズが100x200と解釈されている。

しかし、output.pngは200x200になって欲しい時がある。
つまり指定したサイズよりも必ず大きくなるように変換したい場合。

この場合は

sh convert -geometry 100x200^ input.png output.png

のようにサイズの末尾に^をつける

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?