Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-bit instead of 8-bit PNG output #64

Closed
der-stefan opened this issue Jan 8, 2014 · 8 comments · Fixed by #318
Closed

32-bit instead of 8-bit PNG output #64

der-stefan opened this issue Jan 8, 2014 · 8 comments · Fixed by #318

Comments

@der-stefan
Copy link

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 [...]"
@timautin
Copy link
Contributor

timautin commented Sep 25, 2018

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

@woodpeck
Copy link
Contributor

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.

@timautin
Copy link
Contributor

@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 added a commit to timautin/mod_tile that referenced this issue Sep 25, 2018
…string.

For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png

(closes openstreetmap#64)
@mmd-osm
Copy link

mmd-osm commented Sep 26, 2018

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.

@timautin
Copy link
Contributor

timautin commented Sep 26, 2018

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

@woodpeck
Copy link
Contributor

woodpeck commented Sep 26, 2018

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

@timautin
Copy link
Contributor

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

@mmd-osm
Copy link

mmd-osm commented Sep 26, 2018

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.

timautin added a commit to timautin/mod_tile that referenced this issue Feb 15, 2021
…string.

For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png

(closes openstreetmap#64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants