[Mapserver-users] Mapserver symbols and transparency

Bart van den Eijnden bartvde at xs4all.nl
Wed Mar 17 00:15:57 PST 2004


Hi,

by defining a different OUTPUTFORMAT in your MAP file you can "force" 24 
bit png, e.g.

OUTPUTFORMAT
   NAME PNG24
   DRIVER "GD/PNG"
   MIMETYPE "image/png"
   EXTENSION PNG
   IMAGEMODE RGBA
   TRANSPARENT ON
END

See also:
http://mapserver.gis.umn.edu/doc40/mapfile-reference.html#outputformat

Best regards,
Bart

On Wed, 17 Mar 2004 09:34:45 +0200, James Anderson <james at danisat.net> 
wrote:

> Hiya,
>
> Yes you can create 24bit transparent png files.   The png file has a full
> alpha channel for each pixel, so you actually get translucency.   I 
> cannot
> use GIFs because my company does not like the patent issues involved with
> gifs, and it will still be awhile before the LZW patent expires
> internationally.   I have no idea how GD behaves.   Take a look at the
> images attached.  Ok, ignore the sizes of the images.  The car is 
> smaller in
> the 24bit image.   The problem is with the 24bit image, the parts of the
> image that are transparent become totally transparent in the output 
> image,
> so I can see my webpage background.   I have come to believe this 
> problem is
> because the mapserver only outputs 8bit png files.   Is there any way I 
> can
> force the mapserver to create 24bit images ?
>
> Thanks,
>
> James.
>
>
>
>
> ----- Original Message -----
> From: "Steve Lime" <steve.lime at dnr.state.mn.us>
> To: <james at danisat.net>; <mapserver-users at lists.gis.umn.edu>
> Sent: Tuesday, March 16, 2004 11:45 PM
> Subject: Re: [Mapserver-users] Mapserver symbols and transparency
>
>
> | To be honest with you I've never tried 24-bit symbols. MapServer takes
> | its transparency direction for pixmap symbols
> | from the image file itself. If you supply a transparent GIF then you'll
> | get a transparent symbol. It's been awhile but I
> | believe the transparent directive has no effect in this case. Can you
> | even create 24-bit transparent PNG images, and
> | does GD respect the transparency?
> |
> | Steve
> |
> | >>> "James Anderson" <james at danisat.net> 3/16/2004 10:30:22 AM >>>
> | Hiya,
> |
> | I am having problems using images with transparency for symbols with
> | the pixmap directive.   I am using a .png file as this seems to be the
> | easiest.
> | Here is my problem:  When I use an 8bit png file with transparency, all
> | works fine, the symbol overlays over the map.  The problem occurs when 
> I
> | use a 24bit png file.  It overlays ok, but the portions of the symbol
> | that are transparent become totally transparent in the image output by
> | mapserver.  I Am currently using png format for output.   This means
> | that I can see my webpage background through the image, and this 
> totally
> | sux.   Why is this ?  Am I doing something wrong ?   I would have
> | thought that 24bit images with transparency or translucency would be
> | combined with whatever layers where below the symbol, but it seems not
> | so.  Can anyone help ??
> |
> | Thanks,
> |
> | James.
> | _______________________________________________
> | Mapserver-users mailing list
> | Mapserver-users at lists.gis.umn.edu
> | http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



-- 
  



More information about the MapServer-users mailing list