[mapserver-users] Can't get 8-bit palette output
Jan Hartmann
j.l.h.hartmann at uva.nl
Thu Jan 19 12:24:43 PST 2012
I see. Just for curiosity: why was png/gd dropped and wouldn't it be an
idea to add an option to generate automatically a palette for png 8?
Paletted output is still very useful for choropleth maps.
Jan
On 01/03/2012 04:05 PM, Lime, Steve D (DNR) wrote:
>
> GD is for GIF only in 6.0+. To get paletted output you can set:
>
> -IMAGETYPE GIF (GD-based)
>
> -IMAGETYPE PNG (AGG 8-bit)
>
> -Setup an output format with like Rich G. mentioned
>
> -Setup an output format that forces use of a pre-defined palette
>
> OUTPUTFORMAT
>
> NAME png8
>
> DRIVER "AGG/PNG"
>
> MIMETYPE "image/png"
>
> IMAGEMODE RGB
>
> EXTENSION "png"
>
> FORMATOPTION "INTERLACE=OFF"
>
> FORMATOPTION "PALETTE_FORCE=TRUE"
>
> FORMATOPTION
> "PALETTE=/usr/local/mapserver/apps/mr/compass/compass.palette"
>
> END
>
> Steve
>
> *From:*mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] *On Behalf Of *Jan
> Hartmann
> *Sent:* Monday, January 02, 2012 10:45 AM
> *To:* mapserver-users at lists.osgeo.org
> *Subject:* [mapserver-users] Can't get 8-bit palette output
>
> Happy New Year, all.
>
> I'm porting my applications from MapServer 5.7 to 6.0.1, and I am
> unable to get 8-bit palette output. The MapScript commands are:
>
> $oMap->outputformat->set('driver','GD/PNG');
> $oMap->outputformat->set('imagemode',MS_IMAGEMODE_PC256);
>
> which give me the following warning, and no image:
>
> *Warning*: mapObj::draw() [mapobj.draw
> <http://mapserver.sara.nl/calligo/zl/maps/k1832/mapobj.draw>]:
> [MapServer Error]: agg2CreateImage(): AGG2 driver only supports RGB or
> RGBA pixel models
>
> I tried every combination I coud think of, with GIF and GDAL, and got
> always the same result. MapServer was compiled with gd-support:
>
> MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
> SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS
> INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
> Any idea, someone?
>
> Jan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120119/d79b7787/attachment.htm>
More information about the MapServer-users
mailing list