[mapserver-dev] Paletted PNG and Quantization

Christy Nieman cnieman at dmsolutions.ca
Fri Apr 13 11:22:22 EDT 2012


Hi all,

Just wanted to make sure that I'm doing this right before filing a bug:

With MapServer 6.0.2 and master, I wanted to have an 8-bit PNG with the 
colours defined by a palette.  In previous versions of MapServer, all I 
had to do was put

   FORMATOPTION "PALETTE_FORCE=TRUE"
   FORMATOPTION 
"PALETTE=/mnt/data1/mapsherpa_v3_demo_data/map/map_overlay/templates/palette_rgba.txt"

in the OUTPUTFORMAT.  When I did this in MapServer >= 6, I got a very 
ugly output (looked like there was hardly any anti-aliasing happening).  
Looking in mapimageio.c around line 422, I discovered that I needed to 
also have FORMATOPTION "QUANTIZE_COLORS=<a number greater than 0>" in 
the OUTPUTFORMAT or no quantization would happen to add the required 
colours for anti-aliasing.

The documentation for the AGG/PNG driver explicitely says that 
"PALETTE_FORCE=on" is used to reduce image depth with a predefined 
palette. This option is incompatible with the previous quantization 
options.  But this would seem to no longer be true.

Is this a documentation error, or a problem in the mapimageio.c code?

Thanks,
Christy
-- 
Christy Nieman
GIS Technician
DM Solutions Group, Inc.
Email: cnieman at dmsolutions.ca
Web: http://dmsolutions.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20120413/85b70acc/attachment.html


More information about the mapserver-dev mailing list