再次更新
convert input.png -extent 50% -background none output.png
Run Code Online (Sandbox Code Playgroud)
再次更新
也许你的意思是这样的:
convert input.jpg -extent 50% output.jpg
Run Code Online (Sandbox Code Playgroud)
更新答案
也许你的意思是像这样裁剪掉图像的中心:
convert input.jpg -gravity center -crop 50% output.jpg
Run Code Online (Sandbox Code Playgroud)
原答案
像这样:
identify input.jpg # Check dimensions of input image
input.jpg JPEG 304x304 304x304+0+0 8-bit sRGB 37KB 0.000u 0:00.000
# Convert the image to half its size
convert input.jpg -resize 50% output.jpg
identify output.jpg # Check dimensions of output image
output.jpg JPEG 152x152 152x152+0+0 8-bit sRGB 20.2KB 0.000u 0:00.000
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2624 次 |
| 最近记录: |