[OSM-dev] OpenStreetMap
Jon Burgess
jburgess777 at googlemail.com
Mon Nov 19 19:14:57 GMT 2007
> On 17 Nov 2007, at 03:21, Derek Tonn wrote:
>
> > The vast majority of map tiles used by services such as OSM, Google,
> > Yahoo, Microsoft, etc. could easily be reduced to 6-bit color vs. 8-
> > bit color, a shift that would almost immediately save you over 20%
> > in bandwidth consumption and download/display times. Running
> > your .png tiles through a great little service such as PNGSlim (http://people.bath.ac.uk/ea2aced/tech/png/pngslim.zip
> > ) will consistently save you an additional 8-10+ percent in image
> > file sizes. Translated: your service could load/display in one-third
> > less time than most of the other large mapping engines on the web,
> > consuming one-third less bandwidth in the process.
I can fill you in with some details of the Mapnik layer tiles (which is
the example you show on the blog page). We do already do some size
reduction. The original tiles are rendered as 32bit RGBA. These are then
converted to an 8 bit colour palette using the colour palette
quantization functions of ImageMagick.
If the tiles use a very limited palette (for example a plain land/sea
tile) then this already gets a 1 bit colour palette. Because of the
anti-aliasing and alpha blending there are often many more subtle shades
of colour in the tile than might first appear. I agree that in many
cases we could probably drop down to a 6 bit colour palette but I'd be
concerned that in many cases we would suffer some artifacts such as
colour mismatches between adjacent tiles.
I took a look at pngslim but it is of no use to use because the main
tile rendering platform is Linux not Windows. I looked at some similar
tools like optipng and pngcrush and didn't find a worthwhile reduction
in file size. The tools were often quite slow or had other problems like
strange licenses or optimised x86 assembly which failed to compile on a
64 bit machine.
> > I hope you don't mind, but I blogged about that very fact on my
> > Graphics Optimization Blog tonight (http://graphicsoptimization.com/blog/?p=18
> > ). I wanted to illustrate the optimization process as an
> > opportunity to educate others...as well as draw some additional
> > positive attention to your service. You deserve it, as I think what
> > you are building with OSM will be absolutely wonderful!
What tool did you use to produce the 64 colour tile?
Some tiles are _way_ more complex than the example you gave in your
blog, e.g. http://b.tile.openstreetmap.org/12/2043/1362.png
I'd be interested to know how a complex tile like that looks
before/after with a 64 colour palette.
> > I hope you find this information useful! I might be telling you
> > things that you already know, but I think OSM would be an even
> > BETTER tool if all of those tiles could be truly optimized for on-
> > screen display. Have a wonderful weekend! All the best in the
> > months and years to come.
Suggestions and especially pointers to new tools and code to improve the
project are always welcome.
Jon
More information about the dev
mailing list