Make all pixels 80% transparent

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
8-30

Make all pixels 80% transparent

Post by 8-30 »

From the command line, how do I make all pixels of an existing image 80% transparent? I assume it's something along the lines of
convert test.gif -alpha set 80% testalpha.gif
except the above command is complete nonsense according to IM :)

Any help most appreciated, as I just can't seem to find any reference to this in the Usage or Examples.

Regards,
8-30
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Make all pixels 80% transparent

Post by fmw42 »

try this

convert logo: -matte -channel A -evaluate set 20% +channel logo_20pct.png


to make the logo: (IM internal image) 20% transparent.

substitute your image and your percent as desired

see http://www.imagemagick.org/Usage/canvas/

see http://www.imagemagick.org/Usage/transform/#evaluate


you can substitute -alpha on for the older -matte

see http://www.imagemagick.org/Usage/basics/#alpha

For new users of IM, see http://www.imagemagick.org/Usage/

P.S. GIF only supports binary transparency, so you need to use PNG for example which supports full range of transparency.
8-30

Re: Make all pixels 80% transparent

Post by 8-30 »

Thank you very much fmw42, that works perfectly.
Post Reply