Re: Creating PNG file with transparency

Bob Friesenhahn <[email protected]> Thu, 9 Oct 2008 20:20:46 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
On Thu, 9 Oct 2008, Nguyen Vu Hung wrote:
> While I will not write the entire program for you, causing an image color
> to be transparent is quite easy to do via the 'transparent' method of the
> Image class.  For example
>
>  image.transparent("white");

Is this equivalent to

image.matteColor("white");  // ?

No.  The documentation for matteColor() says that it represents the 
"Image matte (frame) color".  While this documentation is terse, it 
basically means that it is the frame color used when drawing a 
decorative frame around the image.


I write:

image.magick("PNG8");
image.write("output.png");

Are they the same?

Probably.
>
Do you mean something like:

Image image( "400x400", "white" );
// write some pixels with
// image.pixelColor
image.write( "output.png" );

You could use
Image image( "400x400", "#FFFFFFFF" );

To specify a transparent white background.

Bob
======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/