【问题标题】:mogrify to add 100px to the left and right of a jpg image?mogrify 在 jpg 图像的左侧和右侧添加 100px?
【发布时间】:2012-07-30 16:30:22
【问题描述】:

我有一个 100 像素 x 100 像素的 jpg 图像。我想使用 bash 中的 mogrify 命令在图像的左侧和右侧添加 100px 的空白。生成的图像应该有 300 像素的宽度和 100 像素的高度。图像将水平居中。

我尝试了mogrify -crop +200+0 image.jpg,但从图像左侧切断了 200 像素。我尝试了mogrify -crop -200+0 image.jpg,但它从图像右侧切断了 200 像素。我无法理解 imagemagick 的文档。通过查看示例代码,我学得最好。

将实现我的目标的命令行语句是什么?

【问题讨论】:

    标签: image-processing imagemagick mogrify


    【解决方案1】:

    我想通了

    mogrify -extent 300x100 -gravity Center image.jpg
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多