Recent

Author Topic: Lazmapviewer: changing brightness of map  (Read 1510 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8574
Lazmapviewer: changing brightness of map
« on: August 13, 2025, 10:33:50 am »
Is there a "simple" way of changing the brightness (and /potentially/ contrast etc.) of the background map?

Yesterday was very sunny, and I noticed that some of the more saturated markers (derived from aircraft positions) were virtually invisible: since the markers can't be made brighter (and making them darker would obscure their colour) it would have been desirable to reduce the brightness of the overall map.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Lazmapviewer: changing brightness of map
« Reply #1 on: August 13, 2025, 11:50:50 am »
Hi,
@MarkMLI:

I don't think this is possible, because maps are defined by the provider and I couldn't find any options in the "mapviewer" component.
There is an option Transparent map, but I don't know what it's for.

B->

Regards,
Dzandaa

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: Lazmapviewer: changing brightness of map
« Reply #2 on: August 13, 2025, 12:28:36 pm »
Some time ago there was an idea by a user to add image processing (brightness and contrast changes, color changes) to the tiles after loading. But I rejected it because i don't know whether map providers would be happy when somebody modifies their maps and because I was worried about speed loss and about opening a box of worms with endless user wishes for more and more image variations.

One possibility how you could achieve this would be to add a new layer with a "pseudo-provider" providing just black tiles. Using the "Opacity" propery of a layer you could then reduce the brightness of the base map by increaing the Opacity of the black layer from 0 (fully transparent = original brightness) to, say, 0.5 (the semitransparent cover layer darkens all colors by 50%).

These black tiles could be created on the fly during loading since tiles, essentially, are just ordinary bitmaps. Some work, however, will be required to find where the MapViewer will refuse to load non-disk files.

@Dzandaa: The "TransparentMap" property is meant for tiles with built-in alpha channel, such as those available from the OpenRailwaymap providers: they have a fully alpha-transparent background and overlaid lines with railway tracks. When you load these maps into the MapViewer you will normally see a black background because the alpha channel is neglected by default. But when you enable the TransparentMap property the map will become transparent, and you'll see the InactiveColor of the MapView as background.


MarkMLl

  • Hero Member
  • *****
  • Posts: 8574
Re: Lazmapviewer: changing brightness of map
« Reply #3 on: August 13, 2025, 01:06:10 pm »
Thanks for that, more or less where I'd got to but I was wondering whether a plugin etc. was relevant.

https://gis.stackexchange.com/questions/241180/how-to-make-openstreet-map-transparent-now has an interesting pointer to serving OSM content locally, using (if I'm reading things correctly) a modified Mapnik stylesheet. I think the implication is that even if the underlying OSM data is guarded jealously its rendering isn't, so- at the very least- inserting sufficient alpha information for a background to show through as part of the download might work.

Via Wikipedia, OSM itself does not have a no-derivatives license, so I think the question is whether the current Map Provider (which of course might in principle be e.g. Google) insists on one.

So I think the sort of image processing you mention is probably acceptable, but it might be necessary to block it unless a "derivatives allowed" property was set true.

I suggest that speed is a separate issue, and in practice the sort of applications which might benefit from a "nighttime mode" might be those where the overlays are the important bit and the background is rarely panned or zoomed.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Dzandaa

  • Hero Member
  • *****
  • Posts: 557
  • From C# to Lazarus
Re: Lazmapviewer: changing brightness of map
« Reply #4 on: August 13, 2025, 05:09:15 pm »
Hi,

@wp:

Thank you very much.

B->
Regards,
Dzandaa

 

TinyPortal © 2005-2018