reducing one channel while enhancing others

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
wxprofessor
Posts: 2
Joined: 2017-09-01T11:47:42-07:00
Authentication code: 1151

reducing one channel while enhancing others

Post by wxprofessor »

I have an image that will be automatically generated repeatedly, that has "too much green" in the image, so I am trying to reduce the level of green... so far I have tried variations of:

Code: Select all

convert in.png -colorspace HSL -colorspace HSL -channel R -evaluate multiply 1.2 -channel B -evaluate multiply 1.1 -channel G -evaluate multiply 1.1 out.png
using one channel at a time, two, or three channels.. and while the green can be reduced, it ends up "messing with" the other colors as well... so I also tried variations of:

Code: Select all

convert  rgb.png  -gamma 1.0,0.4,1.0 out.png
Here is a sample without any edits... I can reduce the green, but my boss says the browns don't show up well enough, and I said well imagemagick can do anything, he said show me.. so here I am 4 hours later asking for help lol :) ... How can we reduce the green and "bring out" the browns? brown is like red and green combined, so ... i don't know.. i've tried everything I can think of :o

Image


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

Re: reducing one channel while enhancing others

Post by fmw42 »

try

Code: Select all

convert Image16.png -channel g -evaluate multiply 0.9 +channel result.png
Adjust the 0.9 as desired. You can also increase the other channels if you want by similar means.
wxprofessor
Posts: 2
Joined: 2017-09-01T11:47:42-07:00
Authentication code: 1151

Re: reducing one channel while enhancing others

Post by wxprofessor »

High, and thank you... unfortunately that results in the same thing I showed above with the -colorspace HSL examples :/ ... i tried variations of multiple and divide, but the results simply are not what the boss is looking for (why i've struggled for so many hours!) ... thanks for trying though! :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: reducing one channel while enhancing others

Post by fmw42 »

Can you explain how you want the green to change? Or provide an example. You can use -modulate B,S,H to shift the hues toward red or blue or just lower the saturation (and optionally increase brightness)

try

Code: Select all

convert Image16.png -modulate 100,100,120 result1.png
convert Image16.png -modulate 100,100,70 result2.png
convert Image16.png -modulate 100,50,100 result3.png
Post Reply