You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maps, text and icons are "blurred" in Windows 10 version (1.19.0) - Resolution problem? #902
changed the title [-]Map, text and icon are "blurred" in Windows 10 version (1.19.0) - Resolution problem?[/-][+]Maps, text and icons are "blurred" in Windows 10 version (1.19.0) - Resolution problem?[/+]on Dec 6, 2025
I don't know if this is the reason for blur in your maps, but map projection between QMS 1.17.x- and QMS 1.18.x+ has changed.
Open View -> Setup Map View . In Projection & Datum window hit Grid symbol button at upper right corner and select World Mercator (OSM) for projection. Result will be EPSG:3857. That solved at least blur issue in OSM based maps after moving to QMS 1.18.x+.
Open View -> Setup Map View . In Projection & Datum window hit Grid symbol button at upper right corner and select World Mercator (OSM) for projection. Result will be EPSG:3857. That solved at least blur issue in OSM based maps after moving to QMS 1.18.x+.
Unfortunately it is already in EPGS:3857 :(
Even changing to UTM the situation does not change!
One years ago I got a similar problem on some maps into QGIS.
I that case the situation was generated by the default resolution of Windows on my Lenovo laptop that is 125% and not 100%.
This kind of settings is very common in many laptop Windows evironment..
In that case the QGIS developer added a function to adjust map resolution based also on this king of setting.
Unfortunatly is not possible to turn resolution at 100% because all other app (and SO too!) would broke!!!
My QMS 1.19.0 tests:
All screenshots are taken from whole 1920x1200 display.
QMS is always displayed using same width x height.
For size comparison, Windows console is shown above QMS window.
Screenshot 1:
Display scale 100% -> QMS map area without blur
Screenshot 2:
Display scale 125% -> QMS map area with blur
Screenshot 3:
Display scale 125% and QMS downscaled to 80% (1.25 x 0.8 = 1.0) -> QMS map area without blur
Total QMS application can get scaled by environment variable QT_SCALE_FACTOR.
First run Windows console command set QT_SCALE_FACTOR=0.80, then run QMS from same console and downscale QMS to 80%.
Both commands can get embedded into a .bat file.
I used this code (generated by ChatGPT! Sorry but I'm not familiar with .bat code!):
@echo off
set "OLD_QT_SCALE=%QT_SCALE_FACTOR%"
set "QT_SCALE_FACTOR=0.80"
start "" /D "your-path-to-qmpashack\QMapShack-1.19.0.0_Portable" "your-path-to-qmpashack\qmapshack.exe"
if defined OLD_QT_SCALE (
set "QT_SCALE_FACTOR=%OLD_QT_SCALE%"
) else (
set "QT_SCALE_FACTOR="
)
Now the blur effect has been fixed but (obviously) the entire UI has been scaled down!
@kiozen The only big change is switching from Qt5 to Qt6. That could have some fallout.
Seems to be the culprit. This discussion handles exactly same blurry image issue with display scale 125% after transition from Qt5 to Qt6. As I understand discussion, Qt5 did some automatism which Qt6 after implementing high DPI functionality does not do anymore.
Reading discussion, I tried to prevent at least TMS maps from blur by some quick and especially dirty modifications of file CMapTMS.cpp:
Inserted line img.setDevicePixelRatio(devicePixelRatio);
after line diskCache->restore(url, img);
After modification
there is no visible impact for display scale 100% , image ultra sharp and no blur, as devicePixelRatio is equal to 1.
output looks like this for display scale 125% devicePixelRatio is equal to 1.25:
-> Image ultra sharp and no blur. But tiles do not join together.
Without modifications tiles join together but show blurry.
Perhaps this could be an approach to solve display scale issue?
Unfortunately, I am not able to find further necessary modification to make tiles fit together.
Adjustments to the scale and all items on map (waypoints, tracks, ...) are also likely. @kiozen: Any idea how to continue?
You might want to play with the IDrawContext::scale variable. But I can't tell if that really helps. I would need to dive deep into that stuff. Haven't done anything for ages with the complete scaling and drawing. Not sure if I find time the next days to have a closer look.
While trying to solve issue in QMS code (and not being sure if I will succeed) you could use a better workaround than setting environment variable QT_SCALE_FACTOR:
Don't ask why bufwidth and bufheight have to by multiplied by devicePixelRatio * devicePixelRatio.
But without, map image does not cover entire canvas window.
The only map types I have for testing are TMS, WMTS and IMG maps. While modification solves blur effect with IMG files, unfortunatley TMS and WMTS files still are blurry, presumably because these are tile based. Tile images become sharp too, when setDevicePixelRatio(devicePixelRatio) applied to image. But then tiles are smaller and there are gaps between tiles. Presumably algorithm to map tiles into canvas in files CMapTMS.cpp etc. has to be modified to fill more tiles at condensed positions. I am afraid this is beyond my skills.
The buffer (size of QImage) covers the visible canvas with an overlap of 50 pixel at each border. This should not be altered.
IDrawContext::run() is the thread that actually draws into the buffer. The area to cover is defined by ref1..4
Therefore the goal is to translate the information covered by the ref1..4 into the pixels of the buffer. Regardless of what kind of map or DEM. I doubt we have to alter the map specific code, because if we have to, we break that fundamental concept.
I still do not understand how the OS scaling affects the canvas. I would expect that the QT framework to tell the canvas to have a smaller size in pixels than it has on the screen. And as the complete window of the app is scaled up it fits. However I do not understand why drawing a "smaller" map results into an up-scaled image without blur. Is this really like that? Or is it just an illusion?
Imho the only reasonable way would be to except the canvas area from scaling and get the real size in pixels for it. But I do not see how this should be implemented in Qt.
As said I am not really into that subject. Therefore I might be wrong.
What I have achieved so far, regardless of QMS screen's display scale:
all map types (IMG, TMS, WMTS, DEM, ...) are displayed without blur
tile-based maps (TMS, WMTS, DEM, ...) join together seamlessly
maps occupy whole QMS map pixel area from edge to edge, regardless of zoom level
for each zoom level, same coordinate range of different map types is mapped to identical QMS map pixels on screen
already existing GIS elements (tracks, routes waypoints, ...) fit to their position on map
when moving QMS toplevel windows between displays of different display scale, for example one monitor is 125% and the other is 100%, maps are redrawn without blur according to display scale
What is still open:
Translation of mouse picks from screen coordinates to device-independend coordinates is not yet ready
Therefore newly created GIS elements do not fit: too large, with offset
Why are formats with GDAL support (like TMS, WMTS) not just done by GDAL but by a custom client implementation?
Because so far GDAL stalled until it received all tiles, whereas the current implementation updated the canvas on incoming tiles. And the current TMS implementation allows java script to handle some special cases.
This code is old. Many of this stuff is outdated. It's hardly know if the formats like GENF and RMAP are used by anyone. And JNX lost importance over the years, too. However if I remove those there will be this one user for sure complaining as if the whole internet broke down. This is the problem with supporting peculiar stuff. Someone wants it, no one wants to maintain it and it's hard to remove.
Compiled in Qt Creator environment I see the following debug messages when tiles are loaded:
Performance still slow when working with TMS maps. Up to 100 tiles are loaded when zooming and panning. This will prevent a fluid working with QMS as it was before.
The code in CMapTMS has issues for sure. The fundamental problem is that by how Qt6 works everything in QMS is done in logical pixels but in TMS we need to position the tiles on physical pixels. Also there is no concept of the physical size of a tile, i.e. the code will scale standard 256px and hidpi 512px tiles to exactly the same size which is clearly not what we want.
I've already spent too much time on this and became a bit too frustrated with the architecture so I'll leave this to someone who is more invested into TMS than me for now.
Edit: The too small issue might be fixable with similar workarounds to what people use to fix the blur issue...
So I'd say leave it in dev at least for now so more people try it and maybe someone gets motivated to look at the TMS code. when the time for the next stable release come and most are unhappy with it you can still revert it.
Current code now needs to download 4 times as much tiles than previous code. That might explain your download lags.
On my PC with 100 Mbit/s network adapter I do notice lags at most if at all when downloading OpenCycleMap tiles with server URL https://a.tile.thunderforest.com/cycle/%1/%2/%3.png .
My cache size is 100 MB with expiration after 8 days and this seems to be far enough. No debug output about cache size issues.
No issues and no debug output messages downloading high DPI tiles using .tms file containing
Screenshot 1 - file Before QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS before HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 256x256 pixel tiles
-> blurry, normal size tile elements labels, lines, symbols, normal size QMS map elements tracks, waypoints, symbols
Screenshot 2 - file Current QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, half size tile elements, normal size QMS map elements
Screenshot 3 - file Current QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1 font_size=16.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1
QMS GUI font size 16 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, almost normal size tile elements, half size QMS map elements
Screenshot 4 - file Current QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=0 font_size=16.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=0
QMS GUI font size 16 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, quarter size tile elements, quarter size QMS map elements
Screenshot 5 - file Current HiDPI QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 512x512 pixel high dpi tiles (URL https://a.tile.thunderforest.com/cycle/%1/%2/%3@2x.png)
-> sharp, normal size tile elements, normal size QMS map elements
Note:
If too small, half size QMS map elements my get scaled: label size, waypoint/POI symbol size, track/route thickness elements.
I played around with some options: QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1 ./qmapshack -d --font-size=12
QT_SCALE_FACTOR=0.5: will scale QMS in general but has no impact for TMS map, many tiles to load and map text not readable QT_ENABLE_HIGHDPI_SCALING=1: 0 or 1 has no impact for TMS map, many tiles to load and map text not readable -font-size=12: GUI fonts will be increase or decrease, but has no impact for TMS map, many tiles to load and map text not readable
For me, it's not a matter of choice either: a sharper display over better readability. I cannot read the map text, because map text is too small. My workflows are broken. They are based on Thunderbird's TMS maps using an API key.
I see following options:
Revert the commit. A blurry display is better than unreadable and slow performance!
Or provide a GUI ON/OFF widget to switch hiDPI support On/Off
Seems like I did end up working more on this after all. 😅
With #1134 TMS maps should now behave as they should. It now renders tiles of all sizes 1:1 so "classic" 256px tiles will look the same as before but larger tiles will now give the behavior one wants from HiDPI tiles (i.e. bigger text).
Gotta disappoint the sharpness fanatics though - this might still have a minimal blur at times but it won't get any better with QMS architecture. There is no such thing as pixel perfect rendering when you do transformations on the tiles, have float errors from all the CRS transforms and logical vs physical pixels, and bilinear interpolation. Displays with non-integer scaling ratios will suffer more from this.
Oh and for WMTS: I noticed that some WMTS sources are in violation of the specification and lie about the size of their tiles (like e.g. basemapAT). That results in HiDPI tiles being drawn too small (so they end up having the same text size as the classic tiles). We could work around that the same way I solved it in TMS, haven't implemented it there yet though.
And no using EPSG:3857 is not enough to make this go away. The only way to make this go away is drop the "reprojection" and skip the CRS acrobatics to just position the tiles by integer pixels into buf. That would also make wraping the map around the antimeridian easy. Since the current "reprojection" is so bad that imho it's unusable anyways I'm very much in favor of dropping it.
Setting Scales to Square makes it actually more blurry for my 1.25 scaling factor. Setting my screen to 2.0 scaling it might make it a little bit better but very hard to tell.
It also does not get rid of the 1px seams between tiles I get (which are worse on 2.0 scaling than on 1.25).
But this would require to reproject properly to the projection chosen for the canvas. Or enforce EPSG:3857 for the canvas
Resampling should be handled at the canvas or drawing context level though so we don't reimplement it in every map class.
Resampling should be handled at the canvas or drawing context level though so we don't reimplement it in every map class.
Makes kind of sense from today's perspective. In the beginning a large focus was on the Garmin maps that simply transform coordinates into pixel space of a projection. Raster maps and online maps were add-ons that evolved over time. The focus has definitely shifted these days. There are many things I would do different for a QMapSahck 2.0. (no, 2.0 never will happen!)
Personally I would favor to handle all raster maps by GDAL. But as mentioned as far as the UX is concerned the feedback of loading tiles wasn't good because GDAL does not update the buffer as tiles are incoming. Not sure if that would be possible with recent versions. Well and the java script thingy. But that is more a feature badly regretted. It was necessary because some interesting servers needed their own crooked URLs. Not sure if that is still an issue today. But I fear there are some users that use the feature for their own purpose and we can't imagine.
I can't help it. This is all code aged for years. Wine might get better over time. Code never does.
I cloned your repo https://github.com/jmlzr/qmapshack.git and checkout branch QMS_902 and compiled based on:
commit 22423f522457cc09d0a23100ae49057c68b6338b (HEAD -> QMS-902, origin/QMS-902)
Author: ---
Date: Fri Jun 26 11:39:45 2026 +0200
[QMS-902] CMapVRT HiDPI read at correct resolution
Same change as to CDemVRT which should behave identical in that regard.
I did some quick tests and compared (based on my stomach feeling) it to QMS current official version:
Vecor map: "Freizeitkarte Nord"
Performance: Better
Display: Sharp
Readability: Very Good
==> overall a real plus
TMS map: "Thunderforest OpencycleMap" with Scale @2x
Performance: Same as before
Display: Sharp
Readability: Very Good
==> overall a real plus
Activity
[-]Map, text and icon are "blurred" in Windows 10 version (1.19.0) - Resolution problem?[/-][+]Maps, text and icons are "blurred" in Windows 10 version (1.19.0) - Resolution problem?[/+]kiozen commentedon Dec 6, 2025
🤔 there has been no change in the code rendering Garmin maps. At least non that has any effect on rendering.
The only big change is switching from Qt5 to Qt6. That could have some fallout.
JFritzle commentedon Dec 6, 2025
I don't know if this is the reason for blur in your maps, but map projection between QMS 1.17.x- and QMS 1.18.x+ has changed.
Open View -> Setup Map View . In Projection & Datum window hit Grid symbol button at upper right corner and select World Mercator (OSM) for projection. Result will be EPSG:3857. That solved at least blur issue in OSM based maps after moving to QMS 1.18.x+.
Dret42 commentedon Dec 6, 2025
Unfortunately it is already in EPGS:3857 :(
Even changing to UTM the situation does not change!
Any other Idea?
Dret42 commentedon Dec 6, 2025
Maybe I found a possible issue...
One years ago I got a similar problem on some maps into QGIS.
I that case the situation was generated by the default resolution of Windows on my Lenovo laptop that is 125% and not 100%.
This kind of settings is very common in many laptop Windows evironment..
In that case the QGIS developer added a function to adjust map resolution based also on this king of setting.
Unfortunatly is not possible to turn resolution at 100% because all other app (and SO too!) would broke!!!
I hope this could be an idea for a fix!
Thanks in advance!
JFritzle commentedon Dec 6, 2025
My QMS 1.19.0 tests:
All screenshots are taken from whole 1920x1200 display.
QMS is always displayed using same width x height.
For size comparison, Windows console is shown above QMS window.
Screenshot 1:

Display scale 100% -> QMS map area without blur
Screenshot 2:

Display scale 125% -> QMS map area with blur
Screenshot 3:

Display scale 125% and QMS downscaled to 80% (1.25 x 0.8 = 1.0) -> QMS map area without blur
Total QMS application can get scaled by environment variable QT_SCALE_FACTOR.
First run Windows console command
set QT_SCALE_FACTOR=0.80, then run QMS from same console and downscale QMS to 80%.Both commands can get embedded into a
.batfile.Usable as workaround?
Dret42 commentedon Dec 6, 2025
Thanks!
I used this code (generated by ChatGPT! Sorry but I'm not familiar with .bat code!):
Now the blur effect has been fixed but (obviously) the entire UI has been scaled down!
I hope for a more robust solution in the future!
Thanks again!
JFritzle commentedon Dec 7, 2025
@kiozen
The only big change is switching from Qt5 to Qt6. That could have some fallout.
Seems to be the culprit. This discussion handles exactly same blurry image issue with display scale 125% after transition from Qt5 to Qt6. As I understand discussion, Qt5 did some automatism which Qt6 after implementing high DPI functionality does not do anymore.
Reading discussion, I tried to prevent at least TMS maps from blur by some quick and especially dirty modifications of file
CMapTMS.cpp:Inserted lines
before line
QPainter p(&buf.image);Inserted line
img.setDevicePixelRatio(devicePixelRatio);after line
diskCache->restore(url, img);After modification
-> Image ultra sharp and no blur. But tiles do not join together.
Without modifications tiles join together but show blurry.
Perhaps this could be an approach to solve display scale issue?
Unfortunately, I am not able to find further necessary modification to make tiles fit together.
Adjustments to the scale and all items on map (waypoints, tracks, ...) are also likely.
@kiozen: Any idea how to continue?
kiozen commentedon Dec 8, 2025
You might want to play with the IDrawContext::scale variable. But I can't tell if that really helps. I would need to dive deep into that stuff. Haven't done anything for ages with the complete scaling and drawing. Not sure if I find time the next days to have a closer look.
JFritzle commentedon Dec 8, 2025
@Dret42
While trying to solve issue in QMS code (and not being sure if I will succeed) you could use a better workaround than setting environment variable
QT_SCALE_FACTOR:Instead, set environment variable
QT_ENABLE_HIGHDPI_SCALINGto value 0 to disable high-dpi scaling; effectively reverting to Qt 5 default behavior.JFritzle commentedon Dec 8, 2025
Following screenshots from Freizeitkarte Luxemburg and using same QMS settings are taken on a 125% scaled display.
Screenshot 1 - QMS 1.19.0 unmodified, environment variable QT_ENABLE_HIGHDPI_SCALING set to 0 -> sharp

Screenshot 2 - QMS 1.19.0 unmodified, environment variable QT_ENABLE_HIGHDPI_SCALING unset -> blurry

Screenshot 3 - QMS 1.19.0 modified, environment variable QT_ENABLE_HIGHDPI_SCALING unset -> sharp

Modified function IDrawContext::resize in file src/qmapshack/canvas/IDrawContext.cpp
from
to
Don't ask why bufwidth and bufheight have to by multiplied by devicePixelRatio * devicePixelRatio.
But without, map image does not cover entire canvas window.
The only map types I have for testing are TMS, WMTS and IMG maps. While modification solves blur effect with IMG files, unfortunatley TMS and WMTS files still are blurry, presumably because these are tile based. Tile images become sharp too, when setDevicePixelRatio(devicePixelRatio) applied to image. But then tiles are smaller and there are gaps between tiles. Presumably algorithm to map tiles into canvas in files CMapTMS.cpp etc. has to be modified to fill more tiles at condensed positions. I am afraid this is beyond my skills.
kiozen commentedon Dec 9, 2025
Maybe a few hints that might help:
Therefore the goal is to translate the information covered by the ref1..4 into the pixels of the buffer. Regardless of what kind of map or DEM. I doubt we have to alter the map specific code, because if we have to, we break that fundamental concept.
I still do not understand how the OS scaling affects the canvas. I would expect that the QT framework to tell the canvas to have a smaller size in pixels than it has on the screen. And as the complete window of the app is scaled up it fits. However I do not understand why drawing a "smaller" map results into an up-scaled image without blur. Is this really like that? Or is it just an illusion?
Imho the only reasonable way would be to except the canvas area from scaling and get the real size in pixels for it. But I do not see how this should be implemented in Qt.
As said I am not really into that subject. Therefore I might be wrong.
JFritzle commentedon Dec 15, 2025
What I have achieved so far, regardless of QMS screen's display scale:
What is still open:
Therefore newly created GIS elements do not fit: too large, with offset
kiozen commentedon Dec 15, 2025
If you want you can push to a branch in your repo and I can test, check and review a bit if time permits
21 remaining items
kiozen commentedon Jun 23, 2026
Because so far GDAL stalled until it received all tiles, whereas the current implementation updated the canvas on incoming tiles. And the current TMS implementation allows java script to handle some special cases.
This code is old. Many of this stuff is outdated. It's hardly know if the formats like GENF and RMAP are used by anyone. And JNX lost importance over the years, too. However if I remove those there will be this one user for sure complaining as if the whole internet broke down. This is the problem with supporting peculiar stuff. Someone wants it, no one wants to maintain it and it's hard to remove.
JFritzle commentedon Jun 23, 2026
GEMF is used to draw BRouter tile selection.
kkarsten62 commentedon Jun 24, 2026
Follow up to #1127 (comment) :
Based on the latest two commits:
Adding the scale factor
@2xto my Thunderforest OCM TMS file will not help:Text are still too small to read:
Compiled in Qt Creator environment I see the following debug messages when tiles are loaded:
Performance still slow when working with TMS maps. Up to 100 tiles are loaded when zooming and panning. This will prevent a fluid working with QMS as it was before.
jmlzr commentedon Jun 24, 2026
The code in
CMapTMShas issues for sure. The fundamental problem is that by how Qt6 works everything in QMS is done in logical pixels but in TMS we need to position the tiles on physical pixels. Also there is no concept of the physical size of a tile, i.e. the code will scale standard 256px and hidpi 512px tiles to exactly the same size which is clearly not what we want.I've already spent too much time on this and became a bit too frustrated with the architecture so I'll leave this to someone who is more invested into TMS than me for now.
kiozen commentedon Jun 24, 2026
ok, in that case it's best to revert the commit. Imho blurry display is better than unreadable.
Any opinions on that?
jmlzr commentedon Jun 24, 2026
Yeah, I'm against it as that breaks IMG again...
Edit: The too small issue might be fixable with similar workarounds to what people use to fix the blur issue...
So I'd say leave it in dev at least for now so more people try it and maybe someone gets motivated to look at the TMS code. when the time for the next stable release come and most are unhappy with it you can still revert it.
JFritzle commentedon Jun 24, 2026
Current code now needs to download 4 times as much tiles than previous code. That might explain your download lags.
On my PC with 100 Mbit/s network adapter I do notice lags at most if at all when downloading OpenCycleMap tiles with server URL
https://a.tile.thunderforest.com/cycle/%1/%2/%3.png.My cache size is 100 MB with expiration after 8 days and this seems to be far enough. No debug output about cache size issues.
No issues and no debug output messages downloading high DPI tiles using .tms file containing
In my opinion, it's a matter of taste: Some prefer sharpness, others prefer better readabilty without closer zoom.
I personally prefer sharpness.
I did some tests on this 3840x2160 pixels display with scale 200%:

See attached screenshots:
Screenshots.zip
Screenshot 1 - file Before QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS before HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 256x256 pixel tiles
-> blurry, normal size tile elements labels, lines, symbols, normal size QMS map elements tracks, waypoints, symbols
Screenshot 2 - file Current QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, half size tile elements, normal size QMS map elements
Screenshot 3 - file Current QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1 font_size=16.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1
QMS GUI font size 16 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, almost normal size tile elements, half size QMS map elements
Screenshot 4 - file Current QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=0 font_size=16.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=0
QMS GUI font size 16 set by command line parameter font-size
Using 256x256 pixel tiles
-> sharp, quarter size tile elements, quarter size QMS map elements
Screenshot 5 - file Current HiDPI QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 font_size=8.jpg
Token with QMS after HiDPI fix
Qt environment variables QT_SCALE_FACTOR=1.0 QT_ENABLE_HIGHDPI_SCALING=1 (default)
QMS GUI font size 8 set by command line parameter font-size
Using 512x512 pixel high dpi tiles (URL https://a.tile.thunderforest.com/cycle/%1/%2/%3@2x.png)
-> sharp, normal size tile elements, normal size QMS map elements
Note:
If too small, half size QMS map elements my get scaled: label size, waypoint/POI symbol size, track/route thickness elements.
kkarsten62 commentedon Jun 25, 2026
I played around with some options:
QT_SCALE_FACTOR=0.5 QT_ENABLE_HIGHDPI_SCALING=1 ./qmapshack -d --font-size=12QT_SCALE_FACTOR=0.5: will scale QMS in general but has no impact for TMS map, many tiles to load and map text not readableQT_ENABLE_HIGHDPI_SCALING=1:0or1has no impact for TMS map, many tiles to load and map text not readable-font-size=12: GUI fonts will be increase or decrease, but has no impact for TMS map, many tiles to load and map text not readableFor me, it's not a matter of choice either: a sharper display over better readability. I cannot read the map text, because map text is too small. My workflows are broken. They are based on Thunderbird's TMS maps using an API key.
I see following options:
jmlzr commentedon Jun 25, 2026
Seems like I did end up working more on this after all. 😅
With #1134 TMS maps should now behave as they should. It now renders tiles of all sizes 1:1 so "classic" 256px tiles will look the same as before but larger tiles will now give the behavior one wants from HiDPI tiles (i.e. bigger text).
Gotta disappoint the sharpness fanatics though - this might still have a minimal blur at times but it won't get any better with QMS architecture. There is no such thing as pixel perfect rendering when you do transformations on the tiles, have float errors from all the CRS transforms and logical vs physical pixels, and bilinear interpolation. Displays with non-integer scaling ratios will suffer more from this.
Oh and for WMTS: I noticed that some WMTS sources are in violation of the specification and lie about the size of their tiles (like e.g. basemapAT). That results in HiDPI tiles being drawn too small (so they end up having the same text size as the classic tiles). We could work around that the same way I solved it in TMS, haven't implemented it there yet though.
kiozen commentedon Jun 26, 2026
Using EPSG:3857 and quadratic scaling should avoid all transformations for tiles.
Edit: well it does not avoid them, but they should deflate to 1:1 rendering with no scaling artifacts.
jmlzr commentedon Jun 26, 2026
What do you mean with "quadratic scaling" here?
And no using EPSG:3857 is not enough to make this go away. The only way to make this go away is drop the "reprojection" and skip the CRS acrobatics to just position the tiles by integer pixels into
buf. That would also make wraping the map around the antimeridian easy. Since the current "reprojection" is so bad that imho it's unusable anyways I'm very much in favor of dropping it.kiozen commentedon Jun 26, 2026
This setup makes TMS maps look sharp and crisp on normal resolution screens.
But this would require to reproject properly to the projection chosen for the canvas. Or enforce EPSG:3857 for the canvas
jmlzr commentedon Jun 26, 2026
Setting Scales to Square makes it actually more blurry for my 1.25 scaling factor. Setting my screen to 2.0 scaling it might make it a little bit better but very hard to tell.
It also does not get rid of the 1px seams between tiles I get (which are worse on 2.0 scaling than on 1.25).
Resampling should be handled at the canvas or drawing context level though so we don't reimplement it in every map class.
kiozen commentedon Jun 26, 2026
Makes kind of sense from today's perspective. In the beginning a large focus was on the Garmin maps that simply transform coordinates into pixel space of a projection. Raster maps and online maps were add-ons that evolved over time. The focus has definitely shifted these days. There are many things I would do different for a QMapSahck 2.0. (no, 2.0 never will happen!)
Personally I would favor to handle all raster maps by GDAL. But as mentioned as far as the UX is concerned the feedback of loading tiles wasn't good because GDAL does not update the buffer as tiles are incoming. Not sure if that would be possible with recent versions. Well and the java script thingy. But that is more a feature badly regretted. It was necessary because some interesting servers needed their own crooked URLs. Not sure if that is still an issue today. But I fear there are some users that use the feature for their own purpose and we can't imagine.
I can't help it. This is all code aged for years. Wine might get better over time. Code never does.
kkarsten62 commentedon Jun 26, 2026
I cloned your repo
https://github.com/jmlzr/qmapshack.gitand checkout branchQMS_902and compiled based on:I did some quick tests and compared (based on my stomach feeling) it to QMS current official version:
Vecor map: "Freizeitkarte Nord"
Performance: Better
Display: Sharp
Readability: Very Good
==> overall a real plus
TMS map: "Thunderforest OpencycleMap" with Scale
@2xPerformance: Same as before
Display: Sharp
Readability: Very Good
==> overall a real plus
Many thanks - I appreciate it!