[OSM-dev] Optimising PNGs / Colour reduction

Robert (Jamie) Munro rjmunro at arjam.net
Thu Nov 29 00:54:43 GMT 2007


-----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.

Robert (Jamie) Munro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTg3Qz+aYVHdncI0RAuO0AKChNW4pMCW2QjvX+H5fyLkEOlMjsACfTt6n
RUfTJJhr7aNLFPt8a/sNQr8=
=TvpS
-----END PGP SIGNATURE-----




More information about the dev mailing list