convert multiple color image into one color

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
ratneshsoni
Posts: 38
Joined: 2010-12-14T03:56:10-07:00
Authentication code: 8675308

convert multiple color image into one color

Post by ratneshsoni » 2012-03-24T01:44:03-07:00

i want to know that is possible in image magick that convert all image color into one color. Like in one image there is 4 different colors and i want to replace these 4colors in one color like in black.
if it could be possible than how..reply soon

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

Re: convert multiple color image into one color

Post by fmw42 » 2012-03-24T09:37:12-07:00

try something like the following.

convert image -fuzz XX% -fill newcolor -opaque oldcolor1 -opaque oldcolor2 -opaque oldcolor3 -opaque oldcolor4 resultimage

The -fuzz XX% is to allow you to change similar colors if your 4 colors are not pure and have some variation. If you can post a link to an example image, then we can probably help better to demonstrate with your image.


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

Post Reply