开发者

Set any white pixels to transparent in ImageMagick using a threshold?

开发者 https://www.devze.com 2023-01-30 04:02 出处:网络
Using ImageMagick, I want to find any pixels that are white and make them transparent. I\'m thinking the key is -threshold but I can\'t work o开发者_JS百科ut how to change a white pixel to transparent

Using ImageMagick, I want to find any pixels that are white and make them transparent. I'm thinking the key is -threshold but I can't work o开发者_JS百科ut how to change a white pixel to transparent using -threshold. Any suggestions most appreciated.


convert input.png -fuzz 10% -transparent white output.png

Note that the order of the arguments is important - -fuzz must come before -transparent.


Would something like this work?

convert input.jpg -fuzz 5% -fill to_color -opaque from_color output.jpg
0

精彩评论

暂无评论...
验证码 换一张
取 消