Bug 115439 - High DPI mode: SVG icons should be preferred over PNG versions when available (comment 34)
Summary: High DPI mode: SVG icons should be preferred over PNG versions when available...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.4.4.2 release
Hardware: All All
: high enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 105489 105778 105950 106191 106682 110356 110457 114444 115912 117158 117846 120851 122536 123480 (view as bug list)
Depends on: 130678
Blocks: HiDPI Icon-Themes-Code-SVG
  Show dependency treegraph
 
Reported: 2018-02-04 13:08 UTC by bugzilla2
Modified: 2023-07-05 15:28 UTC (History)
32 users (show)

See Also:
Crash report or crash signature:


Attachments
Breeze SVG icons in HiDPI screen (LO 6.4.2.2 in Ubuntu 20.04/Arch/Fedora 32) (4.81 KB, image/png)
2020-04-25 06:55 UTC, carlosjosepita
Details
Blurry Elementary SVG toolbar icons (309.13 KB, image/png)
2020-09-02 19:42 UTC, moosetrax
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugzilla2 2018-02-04 13:08:45 UTC
Description:
In the current Icon-Sets there are already some Icons that exist in png AND svg versions. During my research for Bug 114699 I noticed, that the png versions can be deleted and LibO then uses the svg-versions of those Icons. Result is, that those Icons looks WAY better (perfectly sharp, no alias) then the upscaled png-versions.

So the question is, why does LibO still prefer the png-versions over the svg-ones?

Steps to Reproduce:
Open Writer (for example) and look at the icons.

Actual Results:  
They look badly (at least on HiDPI Screns). 

Expected Results:
The svg-icons should be used instead which look way better.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.121 Safari/537.36 Vivaldi/1.95.1077.41
Comment 1 andreas_k 2018-02-24 18:18:09 UTC
Hi

I know that libreoffice can use svg icons but the rendering is bad. So if you tell me that the svg rendering work well this is awesome. I will test it.

In the past only the breeze icon theme was available in svg so it wasn't to important to force the svg bug for me.

For 6.0 I update the elementary icon theme and with 6.1 an additional icon theme will be ready and available in svg.

Thanks for the feedback and please test as much as possible.
Comment 2 andreas_k 2018-02-24 18:57:06 UTC
It would be really awesome if the svg support would work perfect but we are not there. As long as the png files look better they have to be generated.

In windows the svg support is better than on linux fyi, but also not perfect.

If needed I can upload the breeze_svg and elementary_svg icon theme to the extension webpage.
Comment 3 Heiko Tietze 2018-02-25 07:40:49 UTC
There are still a few issues but there is light at the end of the tunnel http://nabble.documentfoundation.org/Re-minutes-of-ESC-call-tt4229391.html#a4229645
Comment 4 bugzilla2 2018-02-26 11:51:49 UTC
Well, for me (on Windows) the SVG Rendering was perfect, but I tested only a few Icons that were available in the Tango-Set (I only deleted the PNGs where SVG where present). So, absolutely possible, that some icons don't render right, when there are attributes missing in the SVG.

But if a patch already exists, and only needs testing, Icon Sets could soon be delivered in SVG at least on Windows :)

PS: Does anybody have a link to Tango Icon Set in SVG? Would be interesting to see how many icons really are broken...
Comment 5 andreas_k 2018-02-26 21:10:37 UTC
Tested the svg icon theme on linux work really good for me. In Virtualbox I had problem on a linux guest system. don't know why.

When I have time I'll upload the svg icon themes to the extension webpage.
Comment 6 andreas_k 2018-02-26 21:17:07 UTC
(In reply to andreas_k from comment #5)

wrong icon theme the rendering on linux is way not perfect.
Comment 7 Tomaz Vajngerl 2018-02-27 01:05:06 UTC
Yes, gtk3 backend has issues (because we use his way of doing HiDPI), which I know how to resolve (already did a proof-of-concept) but I need some spare time to implement it properly. The issue is described in ESC minutes...
Comment 8 Buovjaga 2018-03-07 16:49:36 UTC
*** Bug 115912 has been marked as a duplicate of this bug. ***
Comment 9 Buovjaga 2018-03-07 16:51:05 UTC
*** Bug 105489 has been marked as a duplicate of this bug. ***
Comment 10 Buovjaga 2018-03-07 16:51:51 UTC
*** Bug 105778 has been marked as a duplicate of this bug. ***
Comment 11 Buovjaga 2018-03-07 16:51:56 UTC
*** Bug 105950 has been marked as a duplicate of this bug. ***
Comment 12 Buovjaga 2018-03-07 16:52:00 UTC
*** Bug 106191 has been marked as a duplicate of this bug. ***
Comment 13 Buovjaga 2018-03-07 16:52:05 UTC
*** Bug 106682 has been marked as a duplicate of this bug. ***
Comment 14 Buovjaga 2018-03-07 16:52:09 UTC
*** Bug 110356 has been marked as a duplicate of this bug. ***
Comment 15 Buovjaga 2018-03-07 16:52:14 UTC
*** Bug 110457 has been marked as a duplicate of this bug. ***
Comment 16 Buovjaga 2018-03-07 16:52:17 UTC
*** Bug 114444 has been marked as a duplicate of this bug. ***
Comment 17 Xisco Faulí 2018-06-06 10:10:01 UTC
Dear Tomaz Vajngerl,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 18 Buovjaga 2018-06-08 12:34:46 UTC
*** Bug 117158 has been marked as a duplicate of this bug. ***
Comment 19 Buovjaga 2018-06-18 07:43:00 UTC
*** Bug 117846 has been marked as a duplicate of this bug. ***
Comment 20 Matt 2018-08-09 01:40:42 UTC
Wasn't work just done to introduce new icons in 6.1?  Would it have made sense to work this as part of that?

Is calling this an enhancement accurate?  It's a bug for hi dpi screens, which are really common nowadays. I would think when the interface breaks even if not functionally broken that it's an issue from a usability perspective.  I love LibreOffice, but I keep reverting back to 5.2 so that the UI isn't broken.
Comment 21 Regina Henschel 2018-10-28 12:13:37 UTC
*** Bug 120851 has been marked as a duplicate of this bug. ***
Comment 22 V Stuart Foote 2018-10-31 03:03:14 UTC
*** Bug 105489 has been marked as a duplicate of this bug. ***
Comment 23 Regina Henschel 2018-11-02 16:06:17 UTC
Please notice bug 121130. [Nevertheless, I support to release the svg-themes as soon as possible.]
Comment 24 andreas_k 2018-12-21 11:47:43 UTC
Definitly true but only when the renderer give us the same quality as the png one.
Comment 25 V Stuart Foote 2019-02-15 13:32:08 UTC
*** Bug 122536 has been marked as a duplicate of this bug. ***
Comment 26 V Stuart Foote 2019-02-15 13:32:32 UTC
*** Bug 123480 has been marked as a duplicate of this bug. ***
Comment 27 Xisco Faulí 2019-11-29 12:39:43 UTC
Changing priority to 'high' since the number of duplicates is 5 or higher
Comment 28 andreas_k 2019-11-29 13:25:32 UTC
(In reply to andreas_k from comment #24)
> Definitly true but only when the renderer give us the same quality as the
> png one.

As long as the quality didn't work, I will block the patch.
Comment 29 Matt 2020-02-04 22:09:44 UTC
Just updated to Version: 6.4.0.3 (x64)
Build ID: b0a288ab3d2d4774cb44b62f04d5d28733ac6df8

First build since tracking the blurry/poorly rendered icons on high dpi screens that I've seen the issue fixed.  

On a high dpi monitor (4k), seeing every SVG icon set render as expected, nice and crisp.

Not sure if my comment belongs here or a related issue. Just wanted to share.
Comment 30 Heiko Tietze 2020-02-05 10:44:19 UTC
(In reply to Matt from comment #29)
> Not sure if my comment belongs here or a related issue. 

Thanks for the feedback. SVG is indeed the future, and once we have finished the testing phase we will switch completely.
Comment 31 eisa01 2020-02-20 21:14:06 UTC
SVG icons are rendered blurry on macOS, so adding bug #130678 as a dependency
Comment 32 carlosjosepita 2020-04-25 06:52:02 UTC
> Just updated to Version: 6.4.0.3 (x64) Build ID: b0a288ab3d2d4774cb44b62f04d5d28733ac6df8

> First build since tracking the blurry/poorly rendered icons on high dpi screens that I've seen the issue fixed.  

Well, lucky you. I'm on Ubuntu 20.04, LO 6.4.2.2 (also tested this in Arch and Fedora 32) and SVG icons are still blurry like in barely-recognizable-blurry.
Comment 33 carlosjosepita 2020-04-25 06:55:03 UTC
Created attachment 159915 [details]
Breeze SVG icons in HiDPI screen (LO 6.4.2.2 in Ubuntu 20.04/Arch/Fedora 32)
Comment 34 Jan-Marek Glogowski 2020-06-17 00:23:40 UTC
This is the typical chicken-egg problem: LO's SVG rasterizer / icons broken => default to PNG. Everybody uses PNG (and some complain about blocky icons in HiDPI) => nobody fixes the LO's SVG rasterizer / icons. Some more background info is in bug 133877 comment 11.

And OTOH people can manually select an SVG icon set, so the pressure to fix this isn't really high.

While the SVG icons easily look better when scaled, the PNG icons definitely look better in 100% / non-scaled in Linux.

And it also doesn't help that gtk3 always scales the rasterized icons, so you get the worse 100% SVG icons scaled to HiDPI.
Comment 35 Nate Graham 2020-06-17 02:09:45 UTC
In general I think people with high DPI screens would prefer to use SVG icons and live with or report a small number of bugs with a small number of mid-rendered icons then live with 100% of all icons being pixelated and ugly. Perhaps making the SVG renderer default only for high DPi users of SVG-compatible icon themes would make everyone happy: high DPI users get nicer icons overall, while devs get more user eyeballs (and bug reports, and potential contributors) using the SVG renderer.

FWIW all the icons look flawless to me with the Breeze SVG icon theme and a global 250% scale scale factor
Comment 36 bugzilla2 2020-06-17 09:06:33 UTC
(In reply to Jan-Marek Glogowski from comment #34)
> This is the typical chicken-egg problem: LO's SVG rasterizer / icons broken
> => default to PNG. Everybody uses PNG (and some complain about blocky icons
> in HiDPI) => nobody fixes the LO's SVG rasterizer / icons. Some more
> background info is in bug 133877 comment 11.

I totally agree on that, the main problem is the SVG Rasterizer (I guess that's the same as a SVG Renderer?). But there are plenty of free OpenSource SVG Renderers out there: Inkscape, Chromium, Firefox aso... all support SVG Rendering. Isn't it possible to use the code of those, if the LibO renderer is so hard to fix?

I know its easy to talk like that when you are not a developer, so just my two cents on that ;)
Comment 37 Rizal Muttaqin 2020-07-01 05:23:38 UTC
Just for your information. As an icon designer and mauntainer now all icon themes have SVG versions. So I would say its safe if in some point we reach perfect SVG support, than the PNG version can be removed or moved to the extension sites.
Comment 38 Stéphane Guillou (stragu) 2020-07-25 07:18:29 UTC
*** Bug 131946 has been marked as a duplicate of this bug. ***
Comment 39 Paul Menzel 2020-08-12 11:16:10 UTC
In Debian Sid/unstable with GNOME 3.36.4 and LibreOffice 7.0.0, I switched the icon theme from *Elementary* to *Elementary (SVG)*, and the icons still look blurry on a HiDPI monitor connected over HDMI.
Comment 40 moosetrax 2020-09-02 19:42:42 UTC
Created attachment 165049 [details]
Blurry Elementary SVG toolbar icons

Blurry SVG icons with LibreOffice 7.0.0.3 on Cinnamon 4.2.4 at resolution Cinnamon 4.2.4.
Comment 41 moosetrax 2020-09-02 19:45:08 UTC
(In reply to moosetrax from comment #40)
> Created attachment 165049 [details]
> Blurry Elementary SVG toolbar icons
> 
> Blurry SVG icons with LibreOffice 7.0.0.3 on Cinnamon 4.2.4 at resolution
> Cinnamon 4.2.4.

Editing to provide resolution information for previous comment: 3840x2160
Comment 42 rooooo 2021-01-16 12:31:38 UTC
Confirming blurry SVG (as well as PNG) icons.

Libreoffice 7.0.4.2
Ubuntu 20.04 Xfce4 4.16
4K-Screen@3840x2160
Xfce4 set to 2x window scaling

Probably helpful to narrow down this issue: In general, even PNG icons are rendered correctly with most applications (Firefox, Evolution, Pluma, all XFCE4 UI) - however, the same effect happens with Thunar, where replacing the XFCE4 icon theme with one using SVG also leads to blurry rendering.
Comment 43 bugzilla2 2022-09-01 16:41:21 UTC
Ok,time for an update here too :)
I use SVG-Icons quite a long time now, and for me those always look better than the png versions. I just did an comparison, and the png-version really looks terrible on an high-dpi monitor with 175% scale.

As far as I remember, SVG primarily was an issue on Linux? So can't we just make SVG default on Windows?
Comment 44 bugzilla2 2022-09-01 16:41:38 UTC Comment hidden (obsolete)
Comment 45 V Stuart Foote 2022-09-01 18:50:16 UTC
(In reply to bugzilla2 from comment #44)
> Ok,time for an update here too :)
> I use SVG-Icons quite a long time now, and for me those always look better
> than the png versions. I just did an comparison, and the png-version really
> looks terrible on an high-dpi monitor with 175% scale.
> 
> As far as I remember, SVG primarily was an issue on Linux? So can't we just
> make SVG default on Windows?

Not at all! 

There is no means currently to directly render the SVG into the GUI, meaning they will always be rendered to a bitmap and held in config (per user profile) for the display resolution in use.  Look in %APPDATA%\LibreOffice\4\cache for the entire SVG icon theme rendered to PNG at scale. For performance the entire SVG of the active icon theme is parsed and the corresponding PNGs built on first launch.

The project deploys resolution appropriate 100% (so 96pdi) scaled PNG at three icon sizes small (sc 16x16) large (lc 24x24) and extra large (32 32x32). They are hand lay ups from the source SVG. They render correctly for most non-HDPI/non-scaledUI and remain appropriate for UI or os/DE scaling up to about 150%. They then start to look pixelated at 150% or above.  Since 96-120dpi displays remains the norm for the vast majority of users there is no justification for doing more with the SVG.

Only if your os/DE is being scaled (as response to HiDPI, or by user setting) does it make sense to use SVG. Do it manually, the automated resampling and rendering of the SVG is inferior to the system deployed PNG at the default 100%, i.e. 96dpi resolution.  The mechanism for "detection" of HiDPI (and so automated use of a resampled set of SVG icons)is "thresholded" at 168 dpi.
Comment 46 V Stuart Foote 2022-09-01 18:58:40 UTC
So just need to do it manually when UI is scaled >= 175%, the automated resampling and rendering of the SVG *remains* inferior to the project's deployed PNG at the default 100%, i.e. 96dpi resolution.

When and if the project can refactor to more effectively use the SVG icon sets, the real issue here, that will change.
Comment 47 bugzilla2 2022-09-06 09:02:26 UTC
I did some comparisons between png and svg and Stuart is right, up to 150% the png looks better then the svg. But over 150% scale, the svg looks dramatically better then the png. So can't we male SVG default when scale-factor is over 150%?

Sure we can say: "you can switch it manually in Preferences", but thats not "nice" for new Users that maybe have a first look into LibreOffice (because maybe they want to change from Microsoft Office) and then say: "oh my god, that looks terrible, not thanks, I'll stick to MSO. It may take years for those ppl to make another try, if ever.

And I do believe, that there are even many longterm LibreOffice Users, that might not know that they can "fix" ugly Icons on HiDPI Monitors by swichtching Icon-Sets...


And can you explain that sentence further:
"The mechanism for "detection" of HiDPI is "thresholded" at 168 dpi."
I'm not sure what that means.
Comment 48 V Stuart Foote 2022-09-06 13:38:03 UTC
(In reply to bugzilla2 from comment #47)
> And can you explain that sentence further:
> "The mechanism for "detection" of HiDPI is "thresholded" at 168 dpi."
> I'm not sure what that means.

See the source for CountDPIScaleFactor() [1]. It previously was a single threshold of >168dpi; and that got changed to a mix of dpi and scale factor for bug 100164 for non-macOS builds with [2]

So current thresholding is:

  nDPI > 216
     250 (so 2.5x)
  nDPI > 168
     200 (so 2.0x)
  nDPI > 120
     150 (so 1.5x)
  otherwise 
     100 (or unscaled)

IIUC macOS passes usable dpi details, so does not need the mixed dpi & scale percentage.

Also the nDPI is not the actual hardware provided dpi, rather it is a calculated dpi that the os/DE is reporting--e.g. on Windows the Custom Scaling value, or with use of fractional scaling on your Linux DE. 

=-ref-=
[1] https://opengrok.libreoffice.org/xref/core/vcl/source/window/window.cxx?a=true&r=1df81daa&h=924#919

[2] https://gerrit.libreoffice.org/c/core/+/30379/
Comment 49 bugzilla2 2022-09-12 11:24:10 UTC
Thanks for the explanation :)

That sounds not so bad, but LibO really should offer the same "steps" as the Host-OS (in my case Windows) does, that means 25% steps, not only 50% steps on Windows. Otherwise the Icons look to small or to big on 175% Scale for example. And not only the Icons itself, also the spaces between them (other bugs show that problem).
Comment 50 V Stuart Foote 2022-09-12 13:19:18 UTC
(In reply to bugzilla2 from comment #49)

So guess we would add additional bracketing for a 25% increment in scale factoring.  Like this maybe:

 nDPI > 264
     300 (so 3.0x)
 nDPI > 240
     275 (so 2.75x)
 nDPI > 216
     250 (so 2.5x)
 nDPI > 192
     225 (so 2.25x)
 nDPI > 168
     200 (so 2.0x)
 nDPI > 144
     175 (so 1.75x)
 nDPI > 120
     150 (so 1.5x)
otherwise 
     100 (or unscaled and using the prebuilt PNG)

@Tomaž -- what do you think. Looks easy hackable, but will the current SVG to PNG resampling suffice to generate usable icon themes at the 25% increments? And any other places in the UI that 25% increments would cause problems?
Comment 51 Renato S. Yamane 2022-09-12 15:22:01 UTC
Just to remember this bug was happening also at 100% scale as you can see on the Ckmment below with an screenshot:

https://bugs.documentfoundation.org/show_bug.cgi?id=117158#c4

I cannot test anymore, because I switched back to MS Office.
Comment 52 V Stuart Foote 2022-09-12 16:03:00 UTC
(In reply to Renato S. Yamane from comment #51)
> Just to remember this bug was happening also at 100% scale as you can see on
> the Ckmment below with an screenshot:
> 
> https://bugs.documentfoundation.org/show_bug.cgi?id=117158#c4
> 
> I cannot test anymore, because I switched back to MS Office.

That was never confirmed and in the screen clips provided the LO icons are clearly not 100% or 150% of the native FHD mode--they've been scaled poorly.

The Yoga L380 in use does have a native screen DPI of ~165dpi, so believe it does scale the PNG icons to a higher scale--look in %APPDATA%\LibreOffice\4\cache\Colibre and if 150 shows the PNG rasters were scaled larger (with the pixilation noted). 

To avoid similar on HiDPI displays close to this resolution, *simply* make a selection of an SVG based icon theme. Do not use the default PNG based icon theme.

Anyhow, the set of pre-installed non-SVG icon themes render cleanly from 100 to 150 pct scaling, starting to pixelate above 150 pct. If on a HiDPI display, or working at higher scaling 150 - 300% first use Tools -> Options -> View and switch to the bundled SVG icon sets which will then be resampled into clean PNG sized as needed.

A useful enhancement at this point might be to detect and switch from the PNG icon themes to SVG theme when at a higher scaling factor is in use--i.e. avoid scaling the PNG.
Comment 53 Tomaz Vajngerl 2022-09-12 18:34:14 UTC
(In reply to V Stuart Foote from comment #50)
> (In reply to bugzilla2 from comment #49)
> 
> So guess we would add additional bracketing for a 25% increment in scale
> factoring.  Like this maybe:
> 
>  nDPI > 264
>      300 (so 3.0x)
>  nDPI > 240
>      275 (so 2.75x)
>  nDPI > 216
>      250 (so 2.5x)
>  nDPI > 192
>      225 (so 2.25x)
>  nDPI > 168
>      200 (so 2.0x)
>  nDPI > 144
>      175 (so 1.75x)
>  nDPI > 120
>      150 (so 1.5x)
> otherwise 
>      100 (or unscaled and using the prebuilt PNG)
> 
> @Tomaž -- what do you think. Looks easy hackable, but will the current SVG
> to PNG resampling suffice to generate usable icon themes at the 25%
> increments? And any other places in the UI that 25% increments would cause
> problems?

SVG icons shouldn't be a problem - if they are rendered properly.