Opened 4 years ago
Last modified 4 years ago
#20008 new defect
Unsharp preset icons
Reported by: | Klumbumbus | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | template_report | Cc: | simon04, Don-vip |
Description
First of all, sorry for this ticket, because I know icon rendering in JOSM is a hydra ;)
There is a problem with icons being rendered unsharp depending on their base width and height.
This problem appears not in the mapview but in all other places, e.g. Preset menu, Tags/Membership Dialog, Selection List Dialog, Preset Search window (F3),...
If both dimensions are smaller than 16px or one dimension is uneven then the image is stretched and/or shifted a half pixel which leads to unsharp icons, which can be seen e.g. in ticket:19706#comment:18
Bad image sizes are e.g. 16x15, 13x16, 15x15, 12x12. Fine images sizes are e.g. 16x14, 12x16. (I didn't test bigger sizes)
Different from estimated in ticket:19706#comment:18, there are indeed a lot internal icons which suffer from this problem. Let alone all icons from external presets/mappaint styles.
(Of cause one could rework the problematic icons to add one more transparent pixel row, but that seems to be a bad workaround and would be a ton of work thinking of thousands of internal and external icons.)
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-10-29 00:51:28 +0100 (Thu, 29 Oct 2020) Build-Date:2020-10-29 02:30:54 Revision:17279 Relative:URL: ^/trunk Identification: JOSM/1.5 (17279 en) Windows 10 64-Bit OS Build number: Windows 10 Pro 1909 (18363) Memory Usage: 713 MB / 1820 MB (281 MB allocated, but free) Java version: 1.8.0_271-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1680x1050 (scaling 1.0x1.0) Maximum Screen Size: 1680x1050 Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32 VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files (x86)\josm-latest.jnlp, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Djnlpx.splashport=57097, -Djnlpx.jvm=<java.home>\bin\javaw.exe] Dataset consistency test: No problems found
Attachments (0)
Change History (2)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
The aspect ratio is kept.
One problem is that icons with an uneven (odd) dimension in one direction e.g. 15x16 or 16x13 is shifted a half pixel probably to make it centered. But that makes it unsharp.
The other problem is that an icon with smaller dimensions in both directions is enlarged, e.g. 14x14 is enlarged to 16x16 which makes it unsharp as well.
Both problems were already there before the last changes (except for the Selection list dialog, but that one had no hidpi support).
(As mentioned I didn't test what happens with larger sizes e.g. 160x150)
@simon04:
Why are icons stretched? The image code prior to your changes always kept proportions.