Page 1 of 1

Light a region matching colors

Posted: 2016-02-13T14:51:15-07:00
by agoyen
Hi!,

Is there any way to make a region lighten?, but with fuzz/opaque results included.

Example:

Code: Select all

convert input.jpg -region 73x31+45+36 -fuzz 8% -fill red -opaque '#a9afaf' output.jpg
This transforms the pixels I want to red color.

Now I want those pixels to change its opacity, or to be lighten.

So, I tried:

Code: Select all

convert input.jpg -region 73x31+45+36 -fuzz 8% -fill red -colorize 10% -opaque '#a9afaf' output.jpg
But it lights ALL the region, not just the pixels I chose by using opaque and fuzz.

What can I do to change the brightness of the selected pixels? (The ones colored in red in the first example).

Thank you very much!!!

Re: Light a region

Posted: 2016-02-13T15:57:50-07:00
by agoyen
In order words... I need to change the opacity, brightness, luminosity or similar of a particular color. Is it possible?

Like 'opaque' but instead of replacing a color to another color, change its opacity, brightness, luminosity (which should replace the color as well, but automatically getting the darker o brighter one).

Thanks

Re: Light a region

Posted: 2016-02-13T16:16:00-07:00
by fmw42
try

to change brightness and/or contrast

Code: Select all

convert input.jpg -region 73x31+45+36 -brightness-contrast 20,10 +region output.jpg
to change opacity (make it 75% opaque)

Code: Select all

convert input.jpg -region 73x31+45+36 -alpha set -channel a -evaluate set 75% +channel +region output.jpg

Re: Light a region

Posted: 2016-02-13T16:41:56-07:00
by agoyen
Hello fmw24 and thanks for your answer!!

I think I could not explain myself properly.
I need the opacity/brightness of the color '#a9afaf' in the region to be altered, not the entire region.

Do you know how can I do it?

Thanks again!

Re: Light a region

Posted: 2016-02-13T17:02:30-07:00
by agoyen
I mean... (color '#a9afaf' with -fuzz 8%) represents the pixels I want to change :)

Re: Light a region matching colors

Posted: 2016-02-13T19:29:38-07:00
by fmw42
Can you provide your input image? You can post to some free service such as dropbox.com and put the URL here. Otherwise, try the following to change the a9afaf (which is the same as a9afafff but has specified fully opaque alpha) to about half transparent as a9afaf88.

Note you cannot save to jpg, since jpg does not support transparency. So I have saved to png.

Code: Select all

convert input.jpg -region 73x31+45+36 -channel rgba -fuzz 8% -fill '#a9afaf88' -opaque '#a9afafff' +region output.png

Please, always provide your IM version and platform when asking questions, since syntax may differ.

See viewtopic.php?f=1&t=9620