Modify

Opened 2 years ago

Last modified 2 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)
https://i.imgur.com/5Pkdi9X.png

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 Changed 2 years ago by stoecker

Simply add a mirror entry for these services where it applies.

comment:2 Changed 2 years ago by Don-vip

Cc: wiktorn 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 in reply to:  2 Changed 2 years ago by stoecker

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.

comment:4 Changed 2 years ago by 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?

comment:5 Changed 2 years ago by 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.

comment:6 in reply to:  4 Changed 2 years ago by stoecker

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.

comment:7 in reply to:  5 ; Changed 2 years ago by stoecker

Cc: Klumbumbus 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 Changed 2 years ago by stoecker

Summary: [RFC] Also include layers with a JPG optionAlso include layers with a JPG option

comment:9 Changed 2 years ago by Don-vip

Keywords: jpg png mirror added

comment:10 in reply to:  7 Changed 2 years ago by Klumbumbus

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to naoliv
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.