且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用ImageMagick删除图像中除黑色以外的所有颜色?

更新时间:2023-12-05 17:33:22

要匹配除黑色之外的所有颜色,您可以使用 + opaque#000000

为了包括#000000左右的范围,你可以尝试不同的百分比 fuzz 运算符:

In order to include a little range around #000000 you can try different percentages with the fuzz operator:

convert input.png -fill white -fuzz 10% +opaque "#000000" result.png

使用ImageMagick 6.6.0-1在Windows上