I did a map with Tilemill and currently it's pretty much a monster when you look at the traffic it creates when served with Tilestream. A little bit of map interaction can quickly lead to about 15 to 20MB downstream (that's with PNG24). I tried PNG8 and also JPEG (which has pretty bad quality in my eyes). Does someone know a good solution? Perhaps with using a custom Mapnik export format string?
2 Answers
This is basically how it works - you trade quality for size, or vice-versa, without any cheat-codes. SVG export is not tiled, so it's not an option. You can quantize images with mbpipe, but this isn't necessarily a cure-all, since Mapnik already does a fairly good job organizing them.

- 11,536
- 3
- 36
- 45
-
Doing web design I had big improvements with using pngcrush. Since the time i posted this question I also did some experiments with mbpipe but ran into the problem that there is no standard input/output available for pngcrush – user3582577 Jun 12 '14 at 19:10
-
pngcrush needs to read the PNG input multiple times, so revising it to work with stdin/stdout would be messy and would involve creating a temporary file (or memory blob) to hold a working copy. It would be simple enough to create a little script that copies stdin to a buffer, runs pngcrush on that, and then writes the final output to stdout. – Glenn Randers-Pehrson Jun 18 '14 at 19:21
I appreciate that this is an old question, but the 1.3 format spec for MBTiles now supports WebP
as a tile data format.
WebP boasts substantial size improvements over PNG/JPEG and supports transparency if that's your cup of tea. It's pretty well suited to map tiles as it uses predictive coding, which essentially assumes that adjacent pixels will be similar, which is likely to generally be true for map tiles (citation needed?).
In theory MBTiles files also support an "IETF media type for other formats", which would include gzip
. I've seen this in the wild in one Android app, but wouldn't expect most software to support reading MBTiles maps with gzipped tile data.

- 3,374
- 3
- 26
- 43