[MAPSERVER-USERS] help! agg palette quantize algorithm imperfection

Paul Spencer pspencer at dmsolutions.ca
Fri Jun 6 08:01:37 EDT 2008


Use:

OUTPUTFORMAT
   OUTPUTFORMAT
   NAME "AGG_Q"
   DRIVER "AGG/PNG"
   MIMETYPE "image/png; mode=8bit"
   IMAGEMODE RGB
   EXTENSION "png"
   FORMATOPTION "PALETTE_FORCE=TRUE"
   FORMATOPTION "PALETTE=/path/to/palette.txt"
END

where palette.txt is a text file with RGB tuples in the form:

RRR,GGG,BBB

For example:

0,0,0
255,255,255
127,127,127

MapServer will use AGG 24 bit rendering but reduce the output file to  
8 bit and reserve the colours in your palette.txt file.  This will  
give you consistent colours for the ones you care about.   
Specifically, you should reserve all the colours that you actually  
reference in your map file plus any colours of pixmap symbols.  Don't  
put in more colours than you actually need to because MapServer needs  
to use whatever space is left (255 less your colours) for antialiasing.

Cheers

Paul

On 6-Jun-08, at 7:53 AM, BrainDrain wrote:

>
> I use this output format in my map file:
> OUTPUTFORMAT
> NAME "AGG_Q"
> DRIVER "AGG/PNG"
> MIMETYPE "image/png; mode=8bit"
> IMAGEMODE RGB
> EXTENSION "png"
> FORMATOPTION "QUANTIZE_FORCE=ON"
> FORMATOPTION "QUANTIZE_DITHER=OFF"
> FORMATOPTION "QUANTIZE_COLORS=256"
> END
> but every time map draw called (or map image requested fom cgi  
> mapserv.exe)
> polygons has a little difference in fill color (I think this is  
> because
> color palette recalculated slightly different each time). This is
> unacceptable for me. How can i correct this? (maybe some  
> FORMATOPTION?)
> -- 
> View this message in context: http://www.nabble.com/help%21-agg-palette-quantize-algorithm-imperfection-tp17667733p17667733.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/


More information about the mapserver-users mailing list