Opened 10 years ago

Closed 9 years ago

#2212 closed enhancement (fixed)

Usage of PNG tiles with indexed colors instead of RGB colors

Reported by: Nightbird Owned by: Andy Allan
Priority: major Milestone:
Component: opencyclemap Version:
Keywords: Cc:

Description

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

Change History (3)

comment:1 Changed 10 years ago by Andy Allan

Owner: changed from Andy Allan to Andy Allan
Priority: trivialmajor
Status: newassigned

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!

comment:2 in reply to:  1 Changed 10 years ago by Deelkar

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

comment:3 Changed 9 years ago by Andy Allan

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.