Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Usage of PNG tiles with indexed colors instead of RGB colors #2212

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

Comments

@openstreetmap-trac
Copy link

Reporter: Nightbird
[Submitted to the original trac issue database at 4.44am, Saturday, 22nd August 2009]

Shouldn't we use tiles with indexed colors to save storage and bandwidth? OpenStreetMap does this, too.

@openstreetmap-trac
Copy link
Author

Author: Andy Allan
[Added to the original trac issue at 10.09am, Tuesday, 1st September 2009]

See this email for more on this issue.

when I came across the website www.opencyclemap.org website I noticed
that you use PNGs with RGB colors for the tiles, not PNGs with indexed
colors which is how OpenStreetMap does it.
I was wondering, is there any particular reason you use such big,
bandwith-consuming tiles instead of tiles with indexed colors, which
would be several times smaller?

Yes. The cyclemap uses a great many more colours than the main
openstreetmap layer does, due to a combination of the gradiated hill
colouring and the translucent ("semi-transparent") cycle route highlighting.

When I compare RGB color and indexed
color tiles, I can't notice any difference in style or accuracy, but
the file size of the indexed color tiles is much smaller, which makes me
think, why shouldn't you use them for OpenCycleMap?
I'd love to, since it would massively reduce bandwidth bills, make
applications faster, and allow me to cache more tiles! However, naive
algorithms (such as the png256 built into mapnik) simply examine each
tile on its own to pick the shortlist of indexed colours, which leads to
inconsistencies between tiles and problems where the indexer picks out
anti-aliasing artifacts and thinks that's a main colour. If you know of
any indexing software that takes an "immutable colour palette" (i.e. a
list of major colour values to preserve) then let me know!

@openstreetmap-trac
Copy link
Author

Author: osm[at]deelkar.net
[Added to the original trac issue at 10.36pm, Thursday, 3rd September 2009]

Replying to [comment:1 Andy Allan]:

I'd love to, since it would massively reduce bandwidth bills, make
applications faster, and allow me to cache more tiles! However, naive
algorithms (such as the png256 built into mapnik) simply examine each
tile on its own to pick the shortlist of indexed colours, which leads to
inconsistencies between tiles and problems where the indexer picks out
anti-aliasing artifacts and thinks that's a main colour. If you know of
any indexing software that takes an "immutable colour palette" (i.e. a
list of major colour values to preserve) then let me know!

ImageMagic has the "map" parameter [http://www.imagemagick.org/Usage/quantize/#map] which should do exactly that.

@openstreetmap-trac
Copy link
Author

Author: Andy Allan
[Added to the original trac issue at 9.59am, Monday, 13th September 2010]

This was enabled as part of the server upgrade project. Tiles are now indexed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant