2011-09-14 192 views
1

我試圖將圖片大小從480x800調整爲320x240。以下是結果。原始圖像具有橢圓形的圓形,而調整大小的圖像具有更加球形的形狀。是否可以調整原始圖像的大小,以便圓形和矩形的比例爲原始比例,但較小?調整圖片大小,保持圖片大小 - 初學者問題

imagemagick或gimp(或其他軟件)可以實現這個嗎?

enter image description here

回答

1

這是Imagemagick解決方案。

1)如果你想大圖像只適合320×240箱和離開的比例,使用:

convert test.png -size 320x240 resized.png 

這將產生圖像大小144x240。

http://www.imagemagick.org/Usage/resize/#resize

如果你想大的圖像完全填充特定的圖像大小爲2),用途:

convert test.png -resize 320x240\> \ 
    -size 320x240 xc:blue +swap -gravity center -composite \ 
    resized.jpg 

這將產生圖像大小320×240,在中心調整大小大的圖像和藍色填充,在兩側。

http://www.imagemagick.org/Usage/resize/#space_fill