[OSM-dev] Optimising PNGs / Colour reduction
Andy Allan
gravitystorm at gmail.com
Thu Nov 29 18:10:30 GMT 2007
On Nov 29, 2007 12:54 AM, Robert (Jamie) Munro <rjmunro at arjam.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Artem Pavlenko wrote:
> > Hello,
> >
> > I implemented colour reduction based on oct-tree. It produces good
> > results (despite rather simple approach), fast and is very light on
> > memory. I'm also looking at using different color depths. Someone
> > suggested 6-bit is enough for our maps, does it really work ?
>
> I think we should have a fixed 256 colour palette that we use for all
> tiles, which we work out in advance. Then colour reduction becomes just
> a lookup table. Most tiles won't use all 256 colours, and when they use
> less than 128, we can make it a 7 bit image, when they use less than 64,
> a 6 bit image etc., so that a simple tile will have less colour depth
> than a complicated tile, but all tiles will always have all their
> colours selected from the same 256 master colour set, so there will
> never be a problem at tile boundaries where one tile uses one colour and
> another tile uses a different colour.
And what about alphablending? We have semi-transparent features (such
as the halo around footpaths, which you can see blending with the
cemetery background at
http://www.openstreetmap.org/?lat=51.48321&lon=-0.19006&zoom=17&layers=B0F),
never mind smoothing diagonal lines etc. I wouldn't like to predict in
advance all the colours that are going to be used by rendering the
planet, taking into account e.g. a footpath crossing a river at the
corner of an industrial estate - what colour is the single pixel
that's just beside the other three colours going to be?
Perhaps someone should scrape a large area of the planet and see how
many different RGB values we're using already on a global scale?
Cheers,
Andy
More information about the dev
mailing list