How do I make all the WHITE in an image transparent?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
aLabelMaker
Posts: 19
Joined: 2011-01-10T12:25:14-07:00
Authentication code: 8675308

How do I make all the WHITE in an image transparent?

Post by aLabelMaker »

I have a black and white graphic of some trees. The trees are black and the background is white. I need to make the background transparent.

Any suggestions?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I make all the WHITE in an image transparent?

Post by fmw42 »

convert image -transparent white result.png (any suffix such as gif, tiff that supports transparency --- Note jpg does not support transparency)

see http://www.imagemagick.org/Usage/color_basics/#replace

I suggest as a beginner that you might study

http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... essing.php
Post Reply