Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19706 closed enhancement (fixed)

Selection/Relation list: render primitive icons in HiDPI

Reported by: simon04 Owned by: simon04
Priority: normal Milestone: 20.08
Component: Core Version:
Keywords: hidpi Cc: Klumbumbus, johsin18

Description

Affected lists/tables:

  • Selection list (toggle dialog)
  • Relation list (toggle dialog)
  • Relation editor → "Refers to"

Caused by org.openstreetmap.josm.tools.ImageProvider#getPadded not yielding a HiDPI icon.

Attachments (7)

19706.PNG (11.1 KB ) - added by Klumbumbus 4 years ago.
iconcomparison19706.PNG (107.1 KB ) - added by Klumbumbus 4 years ago.
iconcomparison19706b.PNG (167.9 KB ) - added by Klumbumbus 4 years ago.
iconcomparison19706c.PNG (2.4 KB ) - added by Klumbumbus 4 years ago.
icons_r16942.png (1.4 KB ) - added by gaben 4 years ago.
icons_r16996.png (712 bytes ) - added by gaben 4 years ago.
iconcomparison19706d.PNG (34.1 KB ) - added by Klumbumbus 4 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 by simon04, 4 years ago

Resolution: fixed
Status: assignedclosed

In 16926/josm:

fix #19706 - Selection/Relation list: render primitive icons in HiDPI

comment:2 by Klumbumbus, 4 years ago

Resolution: fixed
Status: closedreopened

Non square icons are deformed now:

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-08-26 23:18:51 +0200 (Wed, 26 Aug 2020)
Build-Date:2020-08-27 01:30:46
Revision:16942
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16942 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 718 MB / 1820 MB (311 MB allocated, but free)
Java version: 1.8.0_261-b12, 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=53845, -Djnlpx.jvm=<java.home>\bin\javaw.exe]
Dataset consistency test: No problems found

Plugins:
+ DirectUpload (35499)
+ HouseNumberTaggingTool (35508)
+ OpeningHoursEditor (35414)
+ PicLayer (35405)
+ RoadSigns (35510)
+ SimplifyArea (35405)
+ apache-commons (35524)
+ buildings_tools (35500)
+ editgpx (35248)
+ imagery-xml-bounds (35313)
+ imagery_offset_db (35405)
+ javafx-windows (35458)
+ jaxb (35092)
+ jna (35092)
+ jogl (1.2.3)
+ measurement (35405)
+ photo_geotagging (35499)
+ photoadjust (35405)
+ reltoolbox (35529)
+ reverter (35499)
+ rex (53)
+ tageditor (35258)
+ tagging-preset-tester (35267)
+ terracer (35499)
+ turnlanes-tagging (283)
+ turnrestrictions (35515)
+ undelete (35521)
+ utilsplugin2 (35487)

by Klumbumbus, 4 years ago

Attachment: 19706.PNG added

comment:3 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 16946/josm:

fix #19706, fix #19725 - ImageProvider/ImageResource: extract ImageResizeMode, add HiDPI support to bounded/padded icons

comment:4 by Klumbumbus, 4 years ago

Resolution: fixed
Status: closedreopened

Sorry, there are some other problems now:

  • the display quality of png icons is much worse (turn restriction plugin dialog)
  • png icons are enlarged when they probably should not, leading to pixelated display (light bulb, magnifying glass) and sometimes they are cut of (relationtoolbox plugin dialog, roadsigns plugin)

(nearly all plugins, and a lot external presets, mappaint styles and imagery sources still use png icons)

  • svg icons are enlarged too leading to unsharp display (amusement arcade, icon is 14x13px)


Build-Date:2020-08-29 20:00:10
Revision:16970
Is-Local-Build:true

Identification: JOSM/1.5 (16970 SVN de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 806 MB / 1804 MB (197 MB allocated, but free)
Java version: 1.8.0_261-b12, 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
Dataset consistency test: No problems found
Last edited 4 years ago by Klumbumbus (previous) (diff)

by Klumbumbus, 4 years ago

Attachment: iconcomparison19706.PNG added

comment:5 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 16978/josm:

fix #19706, fix #19725 - Do not upscale images when using ImageResizeMode.BOUNDED

comment:6 by simon04, 4 years ago

In 16980/josm:

see #19706, see #19725 - Fix HiDPI with ImageResizeMode.BOUNDED

Regression of r16978

comment:7 by simon04, 4 years ago

In 16982/josm:

see #19706, see #19725 - ImageProviderTest: add tests comparing the result with reference images

comment:8 by simon04, 4 years ago

In 16989/josm:

see #19706, see #19725 - ImageProviderTest: add tests comparing the result with reference images (separate images for Java 8)

comment:9 by Klumbumbus, 4 years ago

Resolution: fixed
Status: closedreopened

Oh man, I feel a bit annoying 😳, but there are still some regressions:

  • the quality of pngs is still much worse than in tested (layer list, turn restriction plugin dialog)
  • the amusement arcade icon is still worse in the selection list dialog, but better now in the tags/membership dialog.
  • the relation toolbox plugin dialog icon still has an overflow (could also be a problem of the plugin?)
  • svg icons in the toolbar and in the preset window are now not upscaled to 24px. Well, this is more a kind of a decision of taste. Most preset icons are optimized for 16px. This means most are unsharp at 24px. So for the look of the single icons 24px is worse, while for the look of the whole toolbar 24px is better. Regarding the preset window 32px would be best to have a sharp icon and to see more details of the icon than at 16px (see #13360)

(This is all standard dpi, I didn't test hidpi yet)

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-08-30 23:20:08 +0200 (Sun, 30 Aug 2020)
Build-Date:2020-08-31 01:30:50
Revision:16989
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16989 de) Windows 10 64-Bit
OS Build number: Windows 10 Pro 1909 (18363)
Memory Usage: 851 MB / 1804 MB (365 MB allocated, but free)
Java version: 1.8.0_261-b12, 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
Dataset consistency test: No problems found
Last edited 4 years ago by Klumbumbus (previous) (diff)

by Klumbumbus, 4 years ago

Attachment: iconcomparison19706b.PNG added

comment:10 by Klumbumbus, 4 years ago

There is also a decrease of display quality for downsized svgs in the mapview:


by Klumbumbus, 4 years ago

Attachment: iconcomparison19706c.PNG added

comment:11 by simon04, 4 years ago

Thanks for your sedulous testing, really! Thank you.

I found the culprit for the bad looking tree from comment:10, that is r16946. The explanation is somewhat complicated: source:trunk/resources/images/presets/landmark/trees.svg is first rendered to a 88x87 raster image and then rescaled to 16x16. The second scaling process pre-r16946 used java.awt.Image#getScaledInstance, and due to r16946 java.awt.Graphics2D#scale + java.awt.Graphics#drawImage. The latter causes the bad quality. I'll look into a good fix tomorrow (it's too late now).

by gaben, 4 years ago

Attachment: icons_r16942.png added

by gaben, 4 years ago

Attachment: icons_r16996.png added

comment:12 by gaben, 4 years ago

Also some icons got weird borders:

r16942
r16996

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-08-31 22:55:53 +0200 (Mon, 31 Aug 2020)
Build-Date:2020-09-01 01:30:50
Revision:16996
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16996 hu) Windows 10 64-Bit
OS Build number: Windows 10 Pro for Workstations 2004 (19041)
Memory Usage: 1164 MB / 1820 MB (625 MB allocated, but free)
Java version: 1.8.0_261-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1200 (scaling 1.0x1.0)
Maximum Screen Size: 1920x1200
Best cursor sizes: 16x16 -> 32x32, 32x32 -> 32x32
Dataset consistency test: No problems found

Windows display scaling set to 125%.

Last edited 4 years ago by gaben (previous) (diff)

comment:13 by simon04, 4 years ago

In 16997/josm:

see #19706, see #19725 - ImageProvider: re-activate upscaling of SVG images

comment:14 by simon04, 4 years ago

In 16998/josm:

see #19706, see #19725 - ImageProvider: improve resize quality for raster images

comment:15 by gaben, 4 years ago

Now the icons look good again, thanks! :D (tested on local build)

comment:16 by simon04, 4 years ago

In 17005/josm:

see #19706, see #19725 - Fix ImageResizeModeTest.testCacheKey

comment:17 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

comment:18 by Klumbumbus, 4 years ago

The icons are fine again. The only minor regression I can see is that icons which are smaller than 16px in both dimensions are still unsharp in the selection list dialog (same as in the tags/membership dialog). However I think we can keep it this way as there are not much such icons.

by Klumbumbus, 4 years ago

Attachment: iconcomparison19706d.PNG added

comment:19 by Don-vip, 4 years ago

In 17074/josm:

see #19706, see #19725 - PMD - avoid throwing NPE

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.