Opened 6 years ago
Last modified 6 years ago
#16844 new enhancement
Also include layers with a JPG option
Reported by: | naoliv | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core imagery | Version: | |
Keywords: | jpg png mirror | Cc: | wiktorn, Klumbumbus |
Description
I was thinking if we could offer an alternative for layers that could also be viewed in JPG.
For example, this DigitalGlobe Premium tile has a PNG version with 44K
https://a.tiles.mapbox.com/v4/digitalglobe.316c9a2e/16/24021/36857.png?access_token=pk.eyJ1IjoiZGlnaXRhbGdsb2JlIiwiYSI6ImNqZGFrZ2c2dzFlMWgyd2x0ZHdmMDB6NzYifQ.9Pl3XOO82ArX94fHV289Pg
But the same tile in JPG has 13K
https://a.tiles.mapbox.com/v4/digitalglobe.316c9a2e/16/24021/36857.jpg?access_token=pk.eyJ1IjoiZGlnaXRhbGdsb2JlIiwiYSI6ImNqZGFrZ2c2dzFlMWgyd2x0ZHdmMDB6NzYifQ.9Pl3XOO82ArX94fHV289Pg
We can have a file with only 29.5% of the PNG size, without any noticeable artifacts (PNG on left side, JPG on right side)
I know that this is irrelevant for some people, but sometimes having a faster loading time, less bandwidth usage and (maybe) less disk space used (for caching) is a win.
What I thought: include some kind of information on every layer which could be viewed either in PNG or JPG + an option in Imagery preferences
allowing the user to choose the format which they prefer (PNG or JPG).
Of course I could change all my local layers for this, but then I would lose any updates on them (an access token that was changed, for example)
Any comments about this, please?
Attachments (0)
Change History (10)
comment:1 by , 6 years ago
follow-up: 3 comment:2 by , 6 years ago
Cc: | added |
---|
We already have 4 different entries for DigitalGlobe, duplicating all of them does not sound like a good idea.
We could have in the URL a template parameter {png,jpg} instead of a fixed string.
Wiktor, do you think we could then automatically "downgrade" to JPG if we detect that loading PNG tiles takes too much time?
comment:3 by , 6 years ago
Replying to Don-vip:
We already have 4 different entries for DigitalGlobe, duplicating all of them does not sound like a good idea.
Nobody talked about duplicating them. I talked about the <mirror> feature, which is defined for this and similar purposes.
We could have in the URL a template parameter {png,jpg} instead of a fixed string.
Wiktor, do you think we could then automatically "downgrade" to JPG if we detect that loading PNG tiles takes too much time?
It's not that easy. For most services there are reasons why png is used, when it is used. Usually the reason is that JPG quality is not similar to PNG. Otherwise JPG is the normal choice, as imagery does not really benefit from PNG format if the JPG is properly encoded.
follow-up: 6 comment:4 by , 6 years ago
Ah, my bad. How does JOSM decide if a mirror is used? When the primary URL is unavailable? Or do we offer a GUI to choose a mirror?
follow-up: 7 comment:5 by , 6 years ago
Maybe what we need, is a global setting "reduce internet usage" which should then:
- try more aggressive caching strategies (for plugins, imageries, other data)
- use JPG instead of PNG when available
Implementing heuristics during download might result in unstable decisions, which file to download. And there might be other reasons to reduce bandwidth usage like data caps.
comment:6 by , 6 years ago
Replying to Don-vip:
Ah, my bad. How does JOSM decide if a mirror is used? When the primary URL is unavailable? Or do we offer a GUI to choose a mirror?
ATM - No automatics. User must choose.
follow-up: 10 comment:7 by , 6 years ago
Cc: | added |
---|
Replying to wiktorn:
Maybe what we need, is a global setting "reduce internet usage" which should then:
- try more aggressive caching strategies (for plugins, imageries, other data)
- use JPG instead of PNG when available
Implementing heuristics during download might result in unstable decisions, which file to download. And there might be other reasons to reduce bandwidth usage like data caps.
For the PNG/JPG: Please first analyze how much entries that actually affects. If this are only 5 and 4 of these could be changed to JPG for all users, as PNG has no benefit, then there is not reason.
P.S. That's also for DigitalGlobe: Do we actually need PNG here?
For caching: We have another ticket, which already requests a setup dialog similar to the plugin one for these: #16832.
comment:8 by , 6 years ago
Summary: | [RFC] Also include layers with a JPG option → Also include layers with a JPG option |
---|
comment:9 by , 6 years ago
Keywords: | jpg png mirror added |
---|
comment:10 by , 6 years ago
Replying to stoecker:
P.S. That's also for DigitalGlobe: Do we actually need PNG here?
Imho for Digital Globe we should switch to jpg and for other sources of type photo too if the tiles are nearly the same.
(I once did https://josm.openstreetmap.de/wiki/Maps/Germany?action=diff&version=151 but thats a map.)
Simply add a mirror entry for these services where it applies.