Page 1 of 1

Modifying the alpha level of each pixel from the command lin

Posted: 2014-03-09T17:52:42-07:00
by simotek
Hi all, i'm pretty new to imagemagick, I have a image that is used as a shadow where every pixel has a slightly different alpha value (https://github.com/simotek/Enlightenmen ... bevels.png) is a example. I am trying to make this shadow lighter by multiplying the alpha value of each pixel by the same value eg 2 to make it twice as light so a pixel with a alpha of 32 would now have a alpha value of 64 and one with a value of 12 would have a value of 24.

So far i have only worked out how to set the global alpha value which isn't much use in this case, has anyone got a idea if this can be done with imagemagick or am i off to write a small app to do it?

Cheers
Simon

Re: Modifying the alpha level of each pixel from the command

Posted: 2014-03-09T18:15:21-07:00
by snibgo

Code: Select all

convert in.png -channel A -evaluate Multiply 2 out.png
See http://www.imagemagick.org/script/comma ... p#evaluate for some other operations you can apply to the alpha channel.

[Solved] Modifying the alpha level of each pixel from the cm

Posted: 2014-03-09T18:46:38-07:00
by simotek
Cheers i knew there had to be a easy way somewhere but i couldn't find it something like 0.8 was exactly what i was looking for.