Recoloring Green to Red

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
wierdbeard65
Posts: 3
Joined: 2015-10-02T09:34:39-07:00
Authentication code: 1151

Recoloring Green to Red

Post by wierdbeard65 »

Hi,

I have some icons in PNG format which are basically green (with some grey shadows). Unfortunately, I need them in red!

Sample:

Image

The icons all have graduated fills and have a transparent background. I'm banging my head against the wall trying to figure out the appropriate way to do this. A lot of the methods I have found result in a black background (instead of transparent) or mess up the shading.

Can anyone offer me advice on how to achieve this?

TIA

ImageMagick-6.9.2-3-Q16-x64
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Recoloring Green to Red

Post by fmw42 »

Your image link is broken. We would need to see your image, to give a good response.
wierdbeard65
Posts: 3
Joined: 2015-10-02T09:34:39-07:00
Authentication code: 1151

Re: Recoloring Green to Red

Post by wierdbeard65 »

Thanks. (Crazy quick reply, BTW, wow!!!!)
Odd, I uploaded to dropbox, as suggested, and then put link in IMG tags. Here is the link sans-tags.

https://www.dropbox.com/s/l1kefl43e8sqg ... n.png?dl=0

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

Re: Recoloring Green to Red

Post by fmw42 »

Try

Code: Select all

convert Computer-Green.png -modulate 100,100,40 result_red.png
Change the 40 as desired for the resulting color. see http://www.imagemagick.org/Usage/color_mods/#modulate
wierdbeard65
Posts: 3
Joined: 2015-10-02T09:34:39-07:00
Authentication code: 1151

Re: Recoloring Green to Red

Post by wierdbeard65 »

You, Sir, are a Genius!

Thank you so much, EXACTLY what I needed. (I have to be honest, I'd found that reference, but didn't understand it as I'm not a color technician.)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Recoloring Green to Red

Post by fmw42 »

It would have been better perhaps if the hue values were in degrees rather than the range of 0 to 200 with 100 being no change. But one can convert degrees to the needed range if need be. That way one can use a colorwheel and see how much degree change is needed or one could make a colorwheel that is labeled with the IM range. See http://www.fmwconcepts.com/imagemagick/ ... _chart.jpg
Post Reply