Now that I have sample tiles from my SRTM data, what format do I want to store them in?
An 8 bit paletted image is sufficient. I really only need 2 colours: transparent (below 8000′) and white (above 8000′). All the other colouring is just so it looks nice. (May save space using 64 or 128 colours). Even GIF would work, but I think PNG-8 (color type 3) is a better choice. Interestingly, even palettized PNGs support a full alpha channel for all 256 colours, see the tRNS chunk.
Do all the tiles need to have the same palette? They can, since it’s the same colormap for all the images. Not sure how to convince GDAL / other tools to reuse the palette, though, particularly with the transparency data. I’m guessing I’m going to need a post-processing step after GDAL generates the final slippy map tiles. Maybe that final PNG baking step is the time to enforce a single palette. The other processing I want to do is optimize via one of pngslim pngnq pngcrush optipng advpng. A quick test shows optipng saves 50%, I think by translating 24+8 bit images to 8 bit paletted images. I swear I saw a map hacker’s notes on comparing these tools once.