【问题标题】:Converting jpg image with white background to transparent background png when image object also has white color当图像对象也具有白色时,将具有白色背景的jpg图像转换为透明背景png
【发布时间】:2015-10-21 13:37:39
【问题描述】:

我正在尝试将几个具有白色背景的 JPG 文件转换为具有透明背景的 PNG。 我正在使用以下命令:

convert 2868cif.jpg -fuzz 10% -transparent white 2868cif.png

该命令适用于大多数图像。但是对于具有白色内容的图像,它将它们转换为白色。请参考以下示例图片:

原图

转换图片

从逻辑上讲,我可以理解为什么会发生这种情况。我只是想知道是否有使用 imagemagick 的解决方法?

【问题讨论】:

  • 你解决了这个问题吗?我有同样的问题

标签: imagemagick imagemagick-convert


【解决方案1】:

尝试使用透明颜色填充:

convert input.jpg -fuzz 15% -fill none -draw "matte 0,0 floodfill" output.png

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-31
    • 2012-07-26
    • 1970-01-01
    • 2011-08-07
    • 2021-03-28
    • 2015-02-03
    相关资源
    最近更新 更多