fast simple color replacement

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
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Try this command:
  • convert -fill 'rgb(255,0,0)' image.png -color 'rgb(0,0,0)' -color cyan -fill 'rgb(0,255,0)' -color 'rgb(255,255,255)' -color 'rgb(128,128,128)' image.jpg
Add as many -color option as needed and of course specify your required rgb() colors. If you want this operation done fast, you'll need to code it up as a custom image filter. See http://www.imagemagick.org/script/archi ... hp#filters.[/list]
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Custom filters permit users to easily add custom features to ImageMagick. You will find a sample custom filter as filters//analyze.c in the ImageMagick source distribution. Use it as a model for your own custom filter.
Post Reply