Remove colors

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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo »

Code: Select all

exec("convert original.jpg -monochrome new.jpg");
Or

Code: Select all

exec("convert original.jpg -black-threshold 80% new.jpg");
I think the results will depend on the original image, you may want to do some other comands on it first to reduce the amount of colours etc.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

For a solution that works for specific colors (or even a list of colors) use something like, the inverted color replacement solution given (roughly) in...
http://www.cit.gu.edu.au/~anthony/graph ... or/#opaque
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply