Imagemagickのサイズ変更

Imagemagickのサイズ変更

サイズをパーセンテージに減らすことはおなじみconvert -resize %ですが、画像を700ピクセルから800ピクセルに増やすコマンドは何ですか?横幅も調整する必要があります。画像の全体的な品質と外観を最大限に維持する必要があります。

編集する:

mogrify -resize geometry

画像のサイズを変更する必要があるようです。 協会サイズを変更する方法を調べる次の人のための記事です。

ベストアンサー1

ImageMagicオプションには1つのパラメータconvertがあります。-resizegeometry強力な構文(下記参照) 前の画像サイズと新しい画像サイズの間に必要な関係を表します。

アスペクト比を維持しながら、ある寸法のサイズを明示的な値に調整し、他の寸法のサイズを同じ要素に調整するには、次のように950x700一般形式仕様から値の1つを省略できます。幅または高さの950指定。x700

convert in.jpg -resize x700 out.jpg

必要なことをする必要があります。

最良の出力のために最大の要因は、画像を再圧縮することです。 JPEG画像をエクスポートすると、同じ圧縮オプションと同じソフトウェアを使用しても以前とは少し異なるように圧縮されます(そうしないと、違いが大きくなる可能性があります)。

他の多くのソフトウェアとは異なり、デフォルトは-resizeかなり良いです。それらを邪魔しないことをお勧めします。

サイズ変更のフィルタリングステップに影響を与える微調整オプションに関する@peterphの回答には同意しません。次のオプションを試すのが役に立つとは思いません-filter-define filter:support=...

多くを破ることができますが、正確に何が変わったのかを言うのは難しいです。
最適なサイジングとフィルタリングには予想よりもはるかに多くの数学が必要であるため、数学の修士号がなければ、サイズ変更オプションを使用して遊ぶことはお勧めできません。 (しかし、これは他の場所では良い考えかもしれません。Adobeが間違ったことを見たことがあります。)

私は私たちが写真の写真、つまり現実の世界で実際のカメラで撮った写真について話していると思いました。
線の描画や3Dグラフィックシーンなどの他の場合は、「正しい」サイズ変更が不要な場合や、サイズを変更する特別な方法があります。



-resize geometry、fromのパラメータ構文www.imagemagick.org:

size               General description (actual behavior can vary for different options and settings)

scale%             Height and width both scaled by specified percentage.
scale-x%xscale-y%  Height and width individually scaled by specified percentages. (Only one % symbol needed.)
width              Width given, height automagically selected to preserve aspect ratio.
xheight            Height given, width automagically selected to preserve aspect ratio.
widthxheight       Maximum values of height and width given, aspect ratio preserved.
widthxheight^      Minimum values of width and height given, aspect ratio preserved.
widthxheight!      Width and height emphatically given, original aspect ratio ignored.
widthxheight>      Shrinks an image with dimension(s) larger than the corresponding width and/or height argument(s).
widthxheight<      Enlarges an image with dimension(s) smaller than the corresponding width and/or height argument(s).
area@              Resize image to have specified area in pixels. Aspect ratio is preserved.

おすすめ記事