256 color images

Geoserver WMS has been know so far for the beautiful looking maps it’s able to generate. This is the result of true color rendering, antialiasing, and SLD expressiveness.
Yet, there is a price to pay for such an output: size. Image files generated by the current WMS are big, and this shows up quite evidently when serving maps over slow links. When images are mostly satellite imagery, jpeg can be used with good results, but the same does not apply to vector image, where compression introduces visible artifacts.

To cope with such environments, we decided to go for a different compromise, allowing the user to choose for speed and size, while giving up some of the beauty.
The current 1.5.x branch, setting the stage for the 1.5.1 release, contains a new WMS vendor parameter, “palette”, that allows the user to choose a 256 color palette to be used during rendering and image generation.

As a result, image generation is faster, and files are up to 4 times smaller. This is especially compelling for vector layers where most of the space is filled with uniform color.
By default we ship with the internet safe palette, but you can provide your own, by example: just drop a 256 colors GIF or PNG in the GEOSERVER_DATA_DIR/palettes directory, and refer it from the GetMap request, asking for a PNG or GIF output.

For further details, see the paletted images research page and the WMS vendor parameters page. If you’re eager to test it, grab a recent Geoserver 1.5.x nightly here, and let us know if you enjoyed it: http://geo.openplans.org/nightly/1.5.x/

One Trackback

  1. By color satellite images on April 6, 2010 at 2:25 pm

    […] is from the Moderate Resolution Imaging Spectroradiometer (MODIS) on NASA's Aqua satellite. …256 color images GeoServer BlogThis is the result of true color rendering, antialiasing, and SLD expressiveness. … Image files […]

Download GeoServer