Re: opacity
Patrick Welche <[email protected]> Fri, 28 May 2004 13:04:41 +0100
| Newsgroups | gmane.comp.video.graphicsmagick.core |
|---|---|
| Message-ID | <[email protected]> |
On Wed, May 26, 2004 at 12:39:27PM -0400, Glenn Randers-Pehrson <glennrp> wrote:
> 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
Thank you for the recipe - now I wonder if there isn't something up with
gm display..
I enclose out.png which was created with:
gm convert -matte logo.eps logo.png
gm convert mask.eps mask.png
gm composite -compose copyopacity mask.png logo.png out.png
and I was confused by the outcome, because gm display out.png shows
a ragged circular outline. The whole point of using the mask, was
essentially to use the automatic antialiasing of the mask to get
semitransparent pixels and avoid seeing the pixelation. I just
viewed out.png with firefox on a windoze box, and the outline is
smooth. Bringing up the magnifier in gm display shows cells with
rgba values like (255,255,255,17) so the image really is semitransparent
(though I didn't realise at first), and I was also confused by gm
identify -verbose out.png with
Colors: 3
3120: ( 0, 0, 0, 0) black
160: (102,102,102, 0) grey40
6720: (255,255,255,255) #FFFFFFFF
which doesn't give the game away about the non 255 values in the
alpha channel..
Anyway, it all works in the sense that image is what I wanted.
(I can now just weep because the most popular browser can't display it)
Cheers,
Patrick
PS could gm display's output have something to do with my X setup?
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x20
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
seems there are enough colours available..
out.png
(image/png, 1 KB) - not displayed