AGG, paletted image and transparency (Mapserver 5.0 beta 5)

Flavio Hendry flavio at TYDAC.CH
Thu Aug 30 08:34:25 PDT 2007


Hi Gilles

Did you try TRANSPARENCY alpha (on LAYER level).

Mit freundlichem Gruss / Best Regards
Flavio Hendry

----------------------------------------------------------------
TYDAC Web-Site:  http://www.tydac.ch
TYDAC MapServer: http://www.mapserver.ch
----------------------------------------------------------------
############      Mit freundlichen Gruessen / Kind Regards
############             mailto:flavio at tydac.ch
############         TYDAC AG - http://www.tydac.ch
####    ####        Geographic Information Solutions
####    ####         Luternauweg 12 -- CH-3006 Bern
############   Tel +41 (0)31 368 0180 - Fax +41 (0)31 368 1860
----------------------------------------------------------------


-----Original Message-----
From: Gilles Bassière <gilles.bassiere at MAKINA-CORPUS.COM>
To: MAPSERVER-USERS at LISTS.UMN.EDU
Date: Thu, 30 Aug 2007 16:44:41 +0200
Subject: [UMN_MAPSERVER-USERS] AGG, paletted image and transparency
(Mapserver 5.0 beta 5)

> Hi List,
> 
> I run Mapserver 5.0 beta5 as a WMS server and have some troubles with
> background transparency :(
> 
> In a first attempt, I just replaced my GD OUTPUTFORMAT definition by:
> 
> OUTPUTFORMAT
>    NAME             "png"
>    DRIVER           "AGG/PNG"
>    MIMETYPE         "image/png"
>    IMAGEMODE        "rgba"
>    EXTENSION        "png"
>    FORMATOPTION     "transparent=on"
>    # TileCache can't use meta-tiling on interlaced PNG files...
>    FORMATOPTION     "interlace=off"
> END
> 
> Changed my config to have my OpenLayers pointing directly at
> Mapserver 
> 5.0, launch my browser and... Wow, it looks great !!!
> 
> Then, I tried some optimization and I added to my OUTPUTFORMAT
> element 
> (as seen in "AGG rendering specifics" howto) :
>    FORMATOPTION     "quantize_force=on"
>    FORMATOPTION     "quantize_dither=off"
>    FORMATOPTION     "quantize_colors=256"
> 
> Well, the line work is still beautiful but I now have 2 problems :
> 1) I lost background transparency. My tiles appear with a white 
> background, I tried to change IMAGECOLOR from 255 255 255 to -1 -1
> -1, 
> also to remove this element but it doesn't change anything.
> 2) Fonts and symbols looks very crappy, they are mixed black and
> white 
> where they should be filled with black with a white outline.
> 
> On a random tile, the image size fall from 102KB down to 25KB. Such 
> ratio is not representative at all since it's not an average and it's
> only about vector data but still, quantize option seems very
> interesting 
> and I don't want to give up because of transparency problems.
> 
> Trying to solve the first problem, I found a workaround for the
> second. 
> When I set the TRANSPARENT parameter of the WMS request to 'false'
> (or 
> any value different of 'true'), then fonts and symbols are displayed 
> normally. It could have been ok if TRANSPARENT was not an optional 
> parameter... The map should looks good in the default case.
> 
> Does someone could give more explanation about the quantize option, 
> especially regarding transparency management ?
> 
> If possible, a broader answer about the FORMATOPTION element would
> help 
> a lot. Indeed, it seems like most optimizations are possible through 
> output format tuning. Unfortunately, I have not been able to find any
> reference document on this...
> 
> Regards,
> 
> -- 
> Gilles Bassiere
> MAKINA CORPUS
> 30 rue des Jeuneurs
> FR-75011 PARIS
> http://www.makina-corpus.com



More information about the MapServer-users mailing list