我试图将图像的大小从 480x800 调整为 320x240。以下是结果。原始图像具有椭圆形的圆形,而调整大小的图像具有更球形的形状。是否可以调整原始图像的大小,使圆形和矩形保持原始比例但更小?
imagemagick 或 gimp(或其他软件)可以实现这一点吗?
我试图将图像的大小从 480x800 调整为 320x240。以下是结果。原始图像具有椭圆形的圆形,而调整大小的图像具有更球形的形状。是否可以调整原始图像的大小,使圆形和矩形保持原始比例但更小?
imagemagick 或 gimp(或其他软件)可以实现这一点吗?
Here's Imagemagick solution.
1) If you want large image to just fit 320x240 box and leave proportions, use:
convert test.png -size 320x240 resized.png
That will produce image sized 144x240.
http://www.imagemagick.org/Usage/resize/#resize
2) If you want large image to completely fill a specific image size, use:
convert test.png -resize 320x240\> \
-size 320x240 xc:blue +swap -gravity center -composite \
resized.jpg
That will produce image sized 320x240 with resized big image in center and blue fill on sides.