如果需要,如何使用 imagemagick 调整图像大小以显示水平边距

How to resize an image with imagemagick to show a horizontal margin if required

我正在使用 imagemagick 在我的应用程序中调整照片的大小,但我无法按需要使用它。

谁能帮我想出正确的选项配置组合以满足以下要求:

在 ImageMagick 中,尝试

convert image -resize x213 -gravity center -background white -extent 320x213 result