1
votes

I need to convert existing png 2 areas files : one area is transparent and the other is red or blue opaque (one sample here : http://urlz.fr/31t2). I want to keep the first area tranparent and to convert opaque area to 30 or 50% of opacity. I'm desperatly looking for a solution using Imagemagick, as a radio engineer i'm not comfortable with the IM ressources ... I'm only able to convert the whole image to X% of opacity (convert input.png -alpha set -channel A -evaluate set 50% output.png )but that's not what i am looking for !

2

2 Answers

1
votes

Thanks for your quick and accurate answer to my not so accurate question! That looks like something i have just found (excepted the use of "u" as a variable rather than a value) :

convert input -channel A -fx "(a>0.99)?0.3:0" output

For sure, your writing is more elegant !

0
votes

Your question is quite hard to understand, but I think you want this:

convert image.png -channel A -fx "u>0.9?0.3:u" result.png

Wherever the alpha is more than 0.9, it will be set to 0.3, otherwise it will be untouched.

enter image description here