Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
983 views
in Technique[技术] by (71.8m points)

ruby - RMagick remove white background from image and make it transparent

I need to remove the white background from this image and make the background transparent. So it's just a black tick on the transparent background exported as a png.

e.g. Turn

enter image description here

Into

enter image description here

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

convert image.png -matte -fill none -fuzz 1% -opaque white result.png

Replaces anything white with transparency. The fuzz option includes anything that is almost-white.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...