Change colors respecting other

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
Demiurgo
Posts: 3
Joined: 2015-03-26T04:07:21-07:00
Authentication code: 6789

Change colors respecting other

Post by Demiurgo »

Hello,

I want to change the color of an image, I had thought of replacing colors but the result is pretty bad. I've been testing with gradient and see that the result is much better. I'm trying to find the right formula. I want to change the picture colors but respecting the black and white.


Could anyone help?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Change colors respecting other

Post by snibgo »

Demiurgo wrote:I want to change the color of an image
There are many ways to do this. The question is too vague to give a specific answer.

My general technique is in two parts. First, work out what transformation is needed. Perhaps simply "-modulate". Second, decide what pixels need to be transformed. Perhaps a narrow band of hues, and perhaps only those above a certain saturation, or pixels near (in colour) to a selected colour. Make a mask that is white where pixels should be changed.

Then the command is simple: composite the changed over the original, with the mask.
snibgo's IM pages: im.snibgo.com
Demiurgo
Posts: 3
Joined: 2015-03-26T04:07:21-07:00
Authentication code: 6789

Re: Change colors respecting other

Post by Demiurgo »

How can I exclude that black and white is not affected?
What is the best way?
Demiurgo
Posts: 3
Joined: 2015-03-26T04:07:21-07:00
Authentication code: 6789

Re: Change colors respecting other

Post by Demiurgo »

Thanks snibgo. I really helped your reply. I did with only modulate option :D
Post Reply