Creating PNG file with transparency

"Nguyen Vu Hung" <[email protected]> Wed, 8 Oct 2008 12:17:43 +0900
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
Hello all,

In google map[1] , the satellite image and the "road" image[2] are separated.
The browser then look at the "Opacity" of the "road" image[2] and make
it transparent.

My questions are:

1. How to use GM's Image class[0] to make a transparent image like google.png
2. What does "Opacity: (  0,  0,  0,255)      #000000FF" means in the output of
    gm  identify -verbose -verbose google.trans.png.
    What API in GM's Image class do I need?
3. Do I need to set "Matte Color: grey74" and "Background Color:
grey100"[3] if I want to do 1. ?

A sample code would be nice if you are kind enough.

[0] http://www.graphicsmagick.org/Magick++/Image.htm
[1] http://maps.google.com/maps?f=q&hl=en&geocode=&q=%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98%EF%BD%98&sll=35.670859,139.684854&sspn=0.0057,0.013733&ie=UTF8&ll=35.673056,139.682214&spn=0.0114,0.027466&t=h&z=16

[2] wget "http://mt0.google.com/mt/v=w2t.83&hl=en&x=58196&s=&y=25808&z=16&s=Gali"
     mv "v=w2t.83&hl=en&x=58196&s=&y=25808&z=16&s=Gali" google.png

[3] See the output of gm  identify -verbose -verbose google.trans.png [4]
[4]

 [vuhung@ 022.PN8+A]$gm-identify-verbose-verbose google.trans.png
Image: google.trans.png
  Format: PNG (Portable Network Graphics)
  Geometry: 256x256
  Class: DirectClass
  Type: palette with transparency
  Depth: 8 bits-per-pixel component
  Channel Depths:
    Red:      8 bits
    Green:    8 bits
    Blue:     8 bits
    Opacity:  8 bits
  Channel Statistics:
    Red:
      Minimum:                     0
      Maximum:                   255
      Mean:                       86.5410
      Standard Deviation:        119.0525
    Green:
      Minimum:                     0
      Maximum:                   255
      Mean:                       86.1371
      Standard Deviation:        118.9476
    Blue:
      Minimum:                     0
      Maximum:                   255
      Mean:                       86.1485
      Standard Deviation:        118.9452
    Opacity:
      Minimum:                     0
      Maximum:                   255
      Mean:                      197.6069
      Standard Deviation:         86.5552
  Opacity: (  0,  0,  0,255)      #000000FF
  Colors: 41

     42268: (  0,  0,  0,255)    none
        81: ( 15, 15, 15,  0)    grey6
       102: ( 31, 31, 31,  0)    grey12
       134: ( 47, 47, 47,  0)    #2F2F2F00
       225: ( 63, 63, 63,  0)    #3F3F3F00
        76: ( 79, 79, 79,  0)    grey31
       123: ( 95, 95, 95,  0)    #5F5F5F00
        84: (111,111,111,  0)    #6F6F6F00
       206: (127,127,127,  0)    grey50
        65: (160, 16, 20,  0)    #A0101400
        16: (163, 23, 27,  8)    #A3171B08
        11: (166, 31, 35, 16)    #A61F2310
         8: (169, 40, 44, 24)    #A9282C18
        19: (173, 50, 53, 32)    #AD323520
         6: (177, 60, 63, 40)    #B13C3F28
        17: (181, 71, 74, 48)    #B5474A30
        11: (186, 83, 85, 56)    #BA535538
        12: (191, 95, 98, 64)    #BF5F6240
        13: (197,109,112, 72)    #C56D7048
         3: (200,118,120, 88)    #C8767858
        13: (203,124,127, 80)    #CB7C7F50
        75: (143,143,143,  0)    grey56
       142: (159,159,159,  0)    #9F9F9F00
        98: (175,175,175,  0)    #AFAFAF00
       208: (191,191,191,  0)    grey75
        10: (209,141,143, 88)    #D18D8F58
        14: (217,159,161, 96)    #D99FA160
         1: (223,175,176,161)    #DFAFB0A1
        10: (225,179,180,104)    #E1B3B468
         1: (225,181,182,153)    #E1B5B699
         1: (227,186,188,145)    #E3BABC91
         1: (229,191,192,137)    #E5BFC089
       171: (207,207,207,  0)    grey81
       136: (223,223,223,  0)    #DFDFDF00
        10: (233,202,202,112)    #E9CACA70
         1: (236,207,208,177)    #ECCFD0B1
         1: (240,218,218,153)    #F0DADA99
         1: (242,223,223,137)    #F2DFDF89
       225: (239,239,239,  0)    #EFEFEF00
        14: (243,226,227,120)    #F3E2E378
     20923: (255,255,255,177)    #FFFFFFB1
  Filesize: 17.6k
  Interlace: None
  Background Color: grey100
  Border Color: #DFDFDF00
  Matte Color: grey74
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Signature: 1cabe3250d9b235d5ec5108e0d728a83a221b66398f4052aba1026990d9ee53f
  Tainted: False
  User Time: 0.000u
  Elapsed Time: 0:01

-- 
Best Regards,
Nguyen Hung Vu ( Nguyễn Vũ Hưng )
vuhung16plus{remove}@gmail.dot.com , YIM: vuhung16 , Skype: vuhung16dg
A brief profile: http://www.hn.is.uec.ac.jp/~vuhung/Nguyen.Vu.Hung.html
-------------------------------------------------------------------------
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=/
_______________________________________________
Graphicsmagick-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-core