Tiles@home/ColorPallete

From OpenStreetMap

Jump to: navigation, search

Contents

Currently using 24bit

At the moment, the tiles rendered by the t@h clients create 24bit color PNGs. This can result in quite large tiles of up to about 100kb per 256x256 pixel tile. In comparison Mapnik tiles, that use 8 bit colour pallet can be up to 3 - 4 times smaller (of cause this is not the only difference that effects size).

Proposal to move over to 8 bit palleted tiles

My moving over to 8 bit palleted pngs, hopefully the tiles we get on average will be about half the size of the current tiles. This should help save Disk storage on the server, bandwidth used by the server as well as the time it takes for clients to download the tiles which should give a better browsing experience.

Example tiles converted to 8bit

Original 24 bit from the server 256 colors with pngnq -s1 64 colors with pngnq -s1 -n64
Image:1361-orig.png Image:1361-256.png Image:1361-64.png
92751 bytes 46684 bytes 79%correct 0.68meanerr 35883 bytes 80%correct 1.49meanerr
Image:1406-orig.png Image:1406-256.png Image:1406-64.png
100806 bytes (z12/2143/1406) 46543 bytes 79%correct 0.71meanerr 34686 bytes 77%correct 1.35meanerr
Image:22503-orig.png Image:22503-256.png Image:22503-64.png
43342 bytes (z16/34298/22503) 19778 bytes 92%correct 0.3meanerr 14897 bytes 86%correct 0.7meanerr
Image:45029-orig.png Image:45029-256.png Image:45029-64.png
8844 bytes (z17/68608/45029) 5134 bytes 99.7%correct 0.004meanerr 3539 bytes 99.5%correct 0.027meanerr
Image:444648-orig.png Image:444648-256.png Image:444648-64.png
22905 bytes (z17/68865/444648) 11031 bytes 95.6%correct 0.3meanerr 8305 bytes 87.4%correct 0.89meanerr

Issues

People have raised the concern that using palleted data can lead to inconsistent color perception across tile boundaries, as different tiles use different pallets. If you could come up with examples showing this problem, please post these here, so that one can judge if they are significant enough to use up twice as much bandwidth and disk space, compared to the 8 bit pallet

Colors used in osm-map-features

Small bash script grepped thru the osmarender rules osm-map-features-z10 to osm-map-features-z17

for color in `grep "#" osm-map-features-z1* | sed -e 's/#/\n#/g' -e 's/;.*/;/' -e 's/".*/;/' | egrep '#[0-9a-zA-Z]{6};' | sort -i | uniq -i -c | sed 's/ //g'`;
do
echo '| style="background:'`echo $color | sed "s/.*#/#/"`'" | ' `echo $color | sed "s/.*#/#/"` ' || ' `echo $color | sed "s/.*#/#/"` '||' `echo $color | sed "s/#.*//"`;
echo "|-";
done

That gives the following numer of occurences for the color codes:

Color Code Usage
#000000; #000000; 26
#000080; #000080; 1
#0000FF; #0000FF; 1
#008000; #008000; 1
#008080; #008080; 1
#008102; #008102; 2
#00FF00; #00FF00; 1
#00FFFF; #00FFFF; 1
#00bcdf; #00bcdf; 4
#060606; #060606; 5
#101010; #101010; 19
#111111; #111111; 1
#202020; #202020; 10
#222222; #222222; 37
#2e3ae6; #2e3ae6; 8
#3131ff; #3131ff; 5
#31ff31; #31ff31; 5
#333333; #333333; 4
#444444; #444444; 8
#4D5D73; #4D5D73; 8
#505050; #505050; 5
#5A6332; #5A6332; 5
#606060; #606060; 5
#6060ff; #6060ff; 10
#666666; #666666; 21
#6a5a8e; #6a5a8e; 8
#6fc13d; #6fc13d; 8
#6fc18e; #6fc18e; 60
#707070; #707070; 2
#70b971; #70b971; 2
#72bf81; #72bf81; 8
#777777; #777777; 23
#7FC97F; #7FC97F; 14
#800000; #800000; 1
#800080; #800080; 1
#80290a; #80290a; 8
#8040a0; #8040a0; 4
#808000; #808000; 1
#808080; #808080; 57
#8080ff; #8080ff; 40
#809BC0; #809BC0; 16
#B36C4C; #B36C4C; 5
#C0C0C0; #C0C0C0; 1
#E2CF80; #E2CF80; 5
#F3D6B6; #F3D6B6; 8
#FDBF6F; #FDBF6F; 8
#FF0000; #FF0000; 1
#FF00FF; #FF00FF; 1
#FFFF00; #FFFF00; 1
#FFFFFF; #FFFFFF; 1
#a0f0ff; #a0f0ff; 4
#a2aee9; #a2aee9; 1
#a47c41; #a47c41; 3
#a6a642; #a6a642; 2
#aaaaaa; #aaaaaa; 30
#b0b0b0; #b0b0b0; 2
#b5d6f1; #b5d6f1; 74
#bde3cb; #bde3cb; 36
#c00000; #c00000; 5
#c0c0c0; #c0c0c0; 3
#c7f1a3; #c7f1a3; 16
#c95e2a; #c95e2a; 8
#cccccc; #cccccc; 17
#cdabde; #cdabde; 5
#d0d0d0; #d0d0d0; 8
#d18a6a; #d18a6a; 5
#d1ead1; #d1ead1; 6
#d4dcbd; #d4dcbd; 32
#d5f2e0; #d5f2e0; 1
#d79331; #d79331; 4
#dddddd; #dddddd; 8
#dfafdd; #dfafdd; 5
#e0e0e0; #e0e0e0; 16
#e21e2f; #e21e2f; 1
#e3e9f1; #e3e9f1; 6
#e46d71; #e46d71; 14
#e5e0c2; #e5e0c2; 1
#e9dd72; #e9dd72; 13
#ec2d2d; #ec2d2d; 16
#ecd8ff; #ecd8ff; 8
#eecc55; #eecc55; 4
#eeeeee; #eeeeee; 63
#ef7771; #ef7771; 2
#efadaa; #efadaa; 6
#efeaa0; #efeaa0; 6
#f0f0f0; #f0f0f0; 33
#f124cb; #f124cb; 15
#f2caea; #f2caea; 8
#f2f2f2; #f2f2f2; 5
#f6800a; #f6800a; 5
#f6dd0a; #f6dd0a; 5
#f7efb7; #f7efb7; 8
#f7f496; #f7f496; 8
#f7f7f7; #f7f7f7; 16
#f8f8f8; #f8f8f8; 14
#f9574b; #f9574b; 20
#fbfbfb; #fbfbfb; 16
#fcfcfc; #fcfcfc; 12
#fcffc9; #fcffc9; 8
#fcffef; #fcffef; 8
#ff0000; #ff0000; 3
#ff3131; #ff3131; 5
#ffebeb; #ffebeb; 16
#ffff00; #ffff00; 8
#ffff90; #ffff90; 6
#ffffc0; #ffffc0; 6
#ffffff; #ffffff; 73
Personal tools
recent changes