Aplha channel depending on intencity

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
Kevich

Aplha channel depending on intencity

Post by Kevich »

I have grayscale pic, and I need to set alpha channel of each pixel depending on white intecity. So if I have FF of intencity I'll need to have FF alpha channel, 22 -> 22 etc. Could someone help me how to do this using convert command line command
thanks in advance
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Aplha channel depending on intencity

Post by snibgo »

convert in.png -alpha on -channel alpha -fx r out.png
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Aplha channel depending on intencity

Post by fmw42 »

try

convert grayimage.xxx -alpha copy transparentimage.png


see http://www.imagemagick.org/Usage/basics/#alpha_copy
Kevich

Re: Aplha channel depending on intencity

Post by Kevich »

thank's a lot. Both methods are Okay =) i'm new at IM, so have some stucks, that's seems simple
Post Reply