Page 1 of 1

reducing one channel while enhancing others

Posted: 2017-09-01T11:58:01-07:00
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

Re: reducing one channel while enhancing others

Posted: 2017-09-01T12:15:14-07:00
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.

Re: reducing one channel while enhancing others

Posted: 2017-09-01T12:26:24-07:00
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! :)

Re: reducing one channel while enhancing others

Posted: 2017-09-01T12:57:32-07:00
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