How can I replace the color #234567 by the color #223344?

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
bensto

How can I replace the color #234567 by the color #223344?

Post by bensto »

How can I replace the color #234567 in all pixels by the color #223344 ?

As the subject already said I am searching for a way to replace all pixels with the color #234567
in a currently existing picture with the color #223344.

How can I do this with IM?

Ben
rmagick
Posts: 245
Joined: 2006-03-16T17:30:48-07:00
Location: Durham, NC, USA

Re: How can I replace the color #234567 by the color #223344?

Post by rmagick »

Use the -opaque option for the convert command.
bensto

Re: How can I replace the color #234567 by the color #223344?

Post by bensto »

rmagick wrote:Use the -opaque option for the convert command.
...and how would the full command line look like?

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

Re: How can I replace the color #234567 by the color #223344?

Post by fmw42 »

convert <infile> -fill "#223347" -opaque "#234567" <outfile>

see
http://www.imagemagick.org/Usage/color/#replace
Post Reply