使用阈值在ImageMagick中将任何白色像素设置为透明? [英] Set any white pixels to transparent in ImageMagick using a threshold?

查看:111
本文介绍了使用阈值在ImageMagick中将任何白色像素设置为透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ImageMagick,我想找到任何白色的像素并使它们透明。我认为关键是 -threshold ,但我无法弄清楚如何使用 -threshold 将白色像素更改为透明。任何建议最受赞赏。

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 out how to change a white pixel to transparent using -threshold. Any suggestions most appreciated.

推荐答案

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

请注意参数的顺序很重要 - -fuzz 必须在 -transparent 之前。

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

这篇关于使用阈值在ImageMagick中将任何白色像素设置为透明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆