How to change red color in a picture into black color

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
User avatar
glennrp
Posts: 1148
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: How to change red color in a picture into black color

Post by glennrp » 2006-10-12T07:56:05-07:00

fiesaskao wrote: Hi, I'm a new user in ImageMagick. I would like to change the red color which appears to our sight into black color, but leave other color still the same. For example, I would like to change Santa Claus' red clothes into black, but the colors of other things which are not appearing red are still the same. The Christmas tree in that picture is still green.

Please help me!
Thanks in advance for any help.[/img]
  • convert -fill black -opaque red in.png out.png

User avatar
anthony
Posts: 8871
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-10-12T17:32:09-07:00

If this does not match the 'red' color add a -fuzz 10% to also concert near-red colors.

See.. IM Examples Fuzz Factor
http://www.cit.gu.edu.au/~anthony/graph ... olor/#fuzz
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply