Re: opacity

"Glenn Randers-Pehrson <glennrp>" <[email protected]> Wed, 26 May 2004 12:39:27 -0400
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
"Glenn Randers-Pehrson " wrote:
> 
> Patrick Welche wrote:
> >
> > This is probably a FAQ, but I haven't found a solution. Essentially I
> > want to do
> >
> >   gm convert -mask mask.eps skill.eps out.png
> >
> > but try as I may, out.png is not transparent. I tried converting the eps to
> > png first, so mask.png is an anti-aliased black ellipse on a white background.
> > I then want to say, "make the opacity chanel of out.png the same as the
> > (any of R, G or B) channel of mask.png". I can see how you copy say Red to
> > Red, or Opacity to Opacity, but not from one to the other. (I have a feeling
> > that -mask should do exactly what I want, but it doesn't seem to..)
> >
> > Thoughts?

If mask.png is an opaque grayscale image,
then composite will use its intensity when it wants opacity.

gm convert skill.eps -matte skill_with_matte.miff
gm composite -compose copyopacity null: skill_with_matte.miff mask.png
out.png

Glenn


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click