如何使用Imagemagick替换灰色渐变背景

时间:2018-02-21 20:24:05

标签: background imagemagick image-manipulation

我有几张照片需要删除背景(替换为#ffffff)

我尝试了几种方法,但没有一种方法可以提供良好的效果。

例如。 convert "$i" -fuzz 10% -fill '#ffffff' -opaque white $i-new.png

这会使结果更白,并在白色和阴影之间产生相当粗糙的线条。

image that needs background removed

更多样本图片

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

我想你想要使用左上角的颜色填充洪水:

convert cauli.jpg -fuzz 10% -fill red -draw 'color 0,0 floodfill' result.png

enter image description here

可能使用白色填充物: - )