mod_tile icon indicating copy to clipboard operation
mod_tile copied to clipboard

32-bit instead of 8-bit PNG output

Open der-stefan opened this issue 11 years ago • 8 comments

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: png256 32-bit: png

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 [...]"

der-stefan avatar Jan 08 '14 23:01 der-stefan

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: screenshot_20180925-033719

png: screenshot_20180925-035443

timautin avatar Sep 25 '18 01:09 timautin

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 avatar Sep 25 '18 07:09 woodpeck

@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!

timautin avatar Sep 25 '18 15:09 timautin

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.

mmd-osm avatar Sep 26 '18 07:09 mmd-osm

Oh, I didn't notice that. Is there a replacement?

timautin avatar Sep 26 '18 09:09 timautin

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 ;)

woodpeck avatar Sep 26 '18 10:09 woodpeck

Yeah that's what I figured looking quickly at Tirex. mod_tile still seems to be the "official" way to go.

timautin avatar Sep 26 '18 10:09 timautin

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.

mmd-osm avatar Sep 26 '18 10:09 mmd-osm