[mapserver-users] MapServer 6 WMS output to 8-bit PNG

Brad Posthumus posthumusb at AGR.GC.CA
Wed Jul 27 13:04:15 EDT 2011


I'm trying to get MapServer 6.0.1 to generate 8-bit (paletted) PNGs for the
WMS output images, with colour 255 set as transparent. However every attempt
appears to result in 24-bit PNGs. 
My mapfile looks something like this:

MAP
  ..
  IMAGETYPE PNG8
  IMAGECOLOR 255 255 255
  ..
  OUTPUTFORMAT
    NAME png8
    DRIVER "AGG/PNG8"
    MIMETYPE "image/png; mode=8bit"
    IMAGEMODE RGBA
    EXTENSION "png"
    FORMATOPTION "INTERLACE=off"
    FORMATOPTION "QUANTIZE_FORCE=on"
    FORMATOPTION "QUANTIZE_COLORS=256"
    TRANSPARENT ON
  END
..
END

Using these settings results in 24-bit images. I've tested this with
MapServer in both Linux and Windows and get the same result. Quantizing is
working since it's reducing the number of colours to 256 or less, it's just
the image bits-per-pixel which seems to be off. Using IMAGEMODE RGB and
removing TRANSPARENT ON doesn't fix it.

Maybe it's how I'm viewing the image properties (copying from FireFox and
pasting into IrfanView) or perhaps I'm not understanding the OUTPUTFORMAT
documentation. Can someone explain either (1) what I'm doing wrong or (2)
what I'm misinterpreting (or both)?

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/MapServer-6-WMS-output-to-8-bit-PNG-tp6626959p6626959.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list