Modifying the alpha level of each pixel from the command lin

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
simotek
Posts: 2
Joined: 2014-03-09T17:39:36-07:00
Authentication code: 6789

Modifying the alpha level of each pixel from the command lin

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
simotek
Posts: 2
Joined: 2014-03-09T17:39:36-07:00
Authentication code: 6789

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

Post 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.
Post Reply