mod_tile
mod_tile copied to clipboard
32-bit instead of 8-bit PNG output
Rendering meta tiles with mod_tile/renderd always made my hillshade look ugly. This results in the 8 bit PNGs, which Mapnik doesn't rasterize nicely. The difference can be seen here:
8-bit:
32-bit:
Only two lines have to be changed in src/gen_tile.c: Substitute both "png256" with "png"
There are two possible ways:
- Introduce option in user config file (/usr/local/etc/renderd.conf) for bit depth
- Improve Mapnik. Imagemagick can produce nice looking 8-bit PNGs for example by "convert -type Palette -quality 90 [...]"
Any news here? It would be great to have this option. Anyway, thanks @der-stefan! It makes a huge difference on mobile with the Google Maps API, like here in E-walk:
png256:
png:
Side note, Tirex (https://github.com/openstreetmap/Tirex) which can be used as a renderd replacement and works nicely with mod_tile, has a per-style imagetype
configuration option that lets you create 24-bit PNG or even JPEG tiles.
@woodpeck Well I just updated mod_tile's code to make it able to take an OUTPUT_FORMAT parameter for each layer, I'll rather send a pull request than changing my stack. Thanks for the suggestion though!
mod_tile looks quite abandoned since about 3, maybe even 4-5 years. There's quite a number of outstanding pull requests with suggested improvements, but even merging those seems to be difficult. Not that it would make a difference that I'm mentioning this, though. Maybe that's something for one of the upcoming hack weekends.
Oh, I didn't notice that. Is there a replacement?
No, Tirex only replaces the renderd part, not the mod_tile part. (It's a bit confusing because both renderd and mod_tile are in this repository together - however using mod_tile and tirex instead of mod_tile and renderd is perfectly possible.) Also, Tirex doesn't exactly attract a lot of developer interest either. I wouldn't be too concerned about lack of maintenance though - renderd/mod_tile are intensively used in OpenStreetMap's production setup so if it works for them, it likely works for you too ;)
Yeah that's what I figured looking quickly at Tirex. mod_tile still seems to be the "official" way to go.
I wouldn't be too concerned about lack of maintenance though - renderd/mod_tile are intensively used in OpenStreetMap's production setup so if it works for them
Well, it sort of works. However, given how frequently people complain about slow tile rendering or gray tiles, and we already know that there are issues with inefficient queue manegement (#152), I think it's obvious that this area would benefit quite a lot from some rework. Today, most of the CPU resources for rendering are more or less idle during the night, as an example.