[mapserver-dev] OUTPUTFORMAT with AGG and IMAGEMODE PC256?

Steve Lime Steve.Lime at dnr.state.mn.us
Tue Aug 12 11:04:44 EDT 2008


If you use palette force then you should get 8-bit output. I'm just using:

 OUTPUTFORMAT
    NAME png
    DRIVER "AGG/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
    FORMATOPTION "INTERLACE=OFF"
    FORMATOPTION "PALETTE_FORCE=TRUE"
    FORMATOPTION "PALETTE=/usr/local/www/docs_maps/compass/compass.palette"
  END

and gdalinfo reports single band output with a palette...

Steve

>>> On 8/12/2008 at 9:39 AM, in message <48A1A097.7030102 at mapgears.com>, Daniel
Morissette <dmorissette at mapgears.com> wrote:
> Dev's,
> 
> Is there a way that we could allow the use of IMAGETYPE PC256 with the 
> AGG/PNG driver, in the interest of reducing the size of the output 
> images? i.e. an OUTPUTFORMAT like this:
> 
> OUTPUTFORMAT
>      NAME                  "png"
>      DRIVER                "AGG/PNG"
>      MIMETYPE              "image/png"
>      IMAGEMODE             "PC256"
>      EXTENSION             "png"
>      FORMATOPTION          "PALETTE_FORCE=TRUE"
>      FORMATOPTION          "PALETTE=/path/to/palette.txt"
>      FORMATOPTION          "INTERLACE=OFF"
> END
> 
> I realize that AGG requires RGB buffers internally to do its 
> antialiasing, but could we not post-process the image to convert it from 
> the internal RGB representation to PC256 before generating the output? 
> With a very simple test that I made, producing the same (very simple) 
> map in PC256 mode instead of RGB makes it pass from 38kb to 5kb... that 
> is quite a gain, well worth the extra CPU time.
> 
> Or is this possible already and if yes what is the OUTPUTFORMAT 
> definition to use?
> 
> Thanks
> 
> Daniel



More information about the mapserver-dev mailing list