Page 1 of 1

Make all pixels 80% transparent

Posted: 2009-09-19T23:12:49-07:00
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

Re: Make all pixels 80% transparent

Posted: 2009-09-19T23:20:02-07:00
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.

Re: Make all pixels 80% transparent

Posted: 2009-09-20T03:41:02-07:00
by 8-30
Thank you very much fmw42, that works perfectly.