[mapserver-dev] Paletted PNG and Quantization
cnieman at dmsolutions.ca
Fri Apr 13 13:06:22 EDT 2012
Thanks for the reply, SteveW.
How does this perform with for creating tiled maps? The reason I use a
palette is to make sure colours of features are the same between tiles.
On 04/13/2012 12:45 PM, Stephen Woodbridge wrote:
> You might try this:
> NAME "agg_qn"
> DRIVER "AGG/PNG"
> EXTENSION "png"
> MIMETYPE "image/png"
> IMAGEMODE RGB
> FORMATOPTION "INTERLACE=false"
> FORMATOPTION "QUANTIZE_NEW=ON"
> FORMATOPTION "QUANTIZE_FORCE=ON"
> FORMATOPTION "QUANTIZE_DITHER=OFF"
> FORMATOPTION "QUANTIZE_COLORS=256"
> #TRANSPARENT ON
> #FORMATOPTION "TRANSPARENT=ON"
> You can replace FORMATOPTION "QUANTIZE_NEW=ON" with your two lines
> below I think.
> -Steve W
> On 4/13/2012 11:22 AM, Christy Nieman wrote:
>> 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"
>> 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?
>> Christy Nieman
>> GIS Technician
>> DM Solutions Group, Inc.
>> Email: cnieman at dmsolutions.ca <mailto:cnieman at dmsolutions.ca>
>> Web: http://dmsolutions.ca
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
More information about the mapserver-dev