Bug 126446 - Pixelated and blurry icons on a fresh Windows 10 install with dpi higher than 125%
Summary: Pixelated and blurry icons on a fresh Windows 10 install with dpi higher than...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 131730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-17 19:01 UTC by Richard
Modified: 2020-09-05 06:31 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of pixelated interface (62.94 KB, image/png)
2019-07-17 19:06 UTC, Richard
Details
with SVG icons, V6.3.0.2 (75.00 KB, image/png)
2019-07-25 16:11 UTC, Richard
Details
SVG Sif icon lc_setoutline from LO cache folder (243 bytes, image/png)
2020-05-10 08:36 UTC, khagaroth
Details
SVG Sif icon lc_setoutline exported using Inkscape at 25x25 (599 bytes, image/png)
2020-05-10 08:37 UTC, khagaroth
Details
SVG Sif icon lc_setoutline properly exported using Inkscape at 24x24 (298 bytes, image/png)
2020-05-10 08:37 UTC, khagaroth
Details
LO 7.0 on Win10 with Sifr svg icon theme scaled 250% (82.15 KB, image/png)
2020-05-10 15:19 UTC, V Stuart Foote
Details
lc_setoutline Sifr-svg at 250% (722 bytes, image/png)
2020-05-10 15:20 UTC, V Stuart Foote
Details
LO 7 Win Colibre-svg icon theme w WDM custom scale at 175% (64.51 KB, image/png)
2020-05-10 15:44 UTC, V Stuart Foote
Details
Comparison of icon rendering in LO 7 beta1 (all at 100%, no scaling) (12.70 KB, image/png)
2020-06-04 16:04 UTC, khagaroth
Details
Comparison of icon rendering in LO 7 beta1 (175%) (17.45 KB, image/png)
2020-06-04 16:28 UTC, khagaroth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2019-07-17 19:01:18 UTC
Description:
Issue On a brand new laptop (Acer Swift 5), resolution Full HD 1920*1080, Windows 10 1803 v17134.137,  GPU intel UHD 620, default dpi factor 150%

I installed Libreoffice 6.2.5.2 x64, but the interface is awful : icons are very pixelated. I tried sevral tricks like deleting the cache, changing the dpi scaling method in Windows (Application : pixelated / System : Blurry ) and desactivated OpenGL with no success. I also tried SVG icons : they are a little bit better but still blurry.

I finally changed my system dpi to 125% and the interface is perfect (but my whole system is too small)



Steps to Reproduce:
1. Install Libreoffice (clean install on a new PC)
2. Launch Libreoffice / Writer with default dpi (150%) --> ICONS pixelated
3. Close Libreoffice
4. Change system dpi to 125%
5. Launch Libreoffice / Writer --> Icons are perfect

Actual Results:
Icons pixelated (Screenshot to follow)

Expected Results:
Icons sharp


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Richard 2019-07-17 19:06:17 UTC
Created attachment 152836 [details]
Screenshot of pixelated interface
Comment 2 Richard 2019-07-21 08:14:30 UTC
Windows update completed to windows 10 v1903 18362.239
Same behaviour with pixelated icons, no change.
Comment 3 V Stuart Foote 2019-07-24 14:08:44 UTC
Default 'Automatic' icon theme selection on Windows are the Colibre icons in PNG. The PNG will be scaled in bulk in response to setting os UI magnification.

That scaling of the PNG bitmaped icons can appear pixeleated at higher valuse--I find 175% to be ugly, %150 is marginal.

Fortunately to support scaling to support HiDPI displays, LibreOffice now provides icon themes as SVG.  The SVG are scaled and then saved in bulk to new PNG corresponding to the UI magnification.

Give the SVGs a test from Tools -> Options -> View: 'Icon Style' droplist then close and reopen LibreOffice--a new SVG derived icon set will be built for the UI magnification set.
Comment 4 Richard 2019-07-25 16:10:44 UTC
Unfortunately, I've already tried that with no succes. On last RC version 6.3.0.2, the icons (Colibre SVG) look strange and still very pixelated. See Screenshot attached
Comment 5 Richard 2019-07-25 16:11:46 UTC
Created attachment 152990 [details]
with SVG icons, V6.3.0.2
Comment 6 QA Administrators 2019-07-30 03:20:36 UTC Comment hidden (obsolete)
Comment 7 khagaroth 2020-04-30 15:40:02 UTC
*** Bug 131730 has been marked as a duplicate of this bug. ***
Comment 8 khagaroth 2020-04-30 15:45:42 UTC
Still broken (both PNG and SVG) in 7 with skia BTW.
Comment 9 khagaroth 2020-05-10 08:36:07 UTC
Created attachment 160587 [details]
SVG Sif icon lc_setoutline from LO cache folder

SVG theme icon from the cache folder as created by the LO icon rendering code. Badly aliased and exported at wrong size (25x25). SVGs should always be exported at power of two sizes to avoid aliasing, though aliasing isn't the only problem - see the following attachments for comparison.
Comment 10 khagaroth 2020-05-10 08:37:23 UTC
Created attachment 160588 [details]
SVG Sif icon lc_setoutline exported using Inkscape at 25x25
Comment 11 khagaroth 2020-05-10 08:37:53 UTC
Created attachment 160589 [details]
SVG Sif icon lc_setoutline properly exported using Inkscape at 24x24
Comment 12 khagaroth 2020-05-10 08:45:55 UTC
Err s/power of two/divisible by two/g
Comment 13 V Stuart Foote 2020-05-10 15:19:15 UTC
Created attachment 160604 [details]
LO 7.0 on Win10 with Sifr svg icon theme scaled 250%

These reports are not a LO bug, rather are an os/DE issue with the Windows Display Manager for Windows. 

MS Winodows mishandles the scaling using the percentage droplist from Display settings -> 'Change the size of text and apps, and other items'--taking the PNG (as rendered at 100% and then scaling).

As shown in attached, the UI is clean if correctly using Display settings -> 'Advance scaling settings', in this clip it is set to 250% with Sifr SVG

Also attaching the same lc_setoutline PNG icon (65px x 65px) generated from the SVG

IMHO => NAB when you use the os/DE correctly.
Comment 14 V Stuart Foote 2020-05-10 15:20:56 UTC
Created attachment 160605 [details]
lc_setoutline Sifr-svg at 250%

clean, crsip generation of PNG icon from SVG graphic with UI scaled 250%
Comment 15 V Stuart Foote 2020-05-10 15:31:47 UTC
I am comfortable closing this NotOurBug as the WDM os/DE does stupid things with the UI scaling (providing two different scaling routines).

@Tomaž, Mike?
Comment 16 V Stuart Foote 2020-05-10 15:44:11 UTC
Created attachment 160606 [details]
LO 7 Win Colibre-svg icon theme w WDM custom scale at 175%
Comment 17 Mike Kaganski 2020-05-10 21:42:25 UTC
(In reply to V Stuart Foote from comment #15)
> I am comfortable closing this NotOurBug as the WDM os/DE does stupid things
> with the UI scaling (providing two different scaling routines).

I'm not convinced it's OS thing.

First, I know that "Change the size of text and apps, and other items" thing *does* activate LO's HiDPI code, and LO has the DPI information from OS to handle the scaling itself. Since LO is HiDPI-aware application (its binaries have corresponding information in the manifests), Windows does not scale its UI itself.

Second, I tried the two different modes ("Change the size of text and apps, and other items" and "Advance scaling settings") on my Win10 1909, and both gave me exactly the same display as in OP's attachment 152836 [details] from comment 1.
Comment 18 V Stuart Foote 2020-05-11 02:29:21 UTC
(In reply to Mike Kaganski from comment #17)
> 
> Second, I tried the two different modes ("Change the size of text and apps,
> and other items" and "Advance scaling settings") on my Win10 1909, and both
> gave me exactly the same display as in OP's attachment 152836 [details] from
> comment 1.

But did you change the Icon theme selection to an SVG theme first?

The PNG icon themes would be scaled poorly and be pixelated. Selecting an SVG theme, which would be parsed at initial launch, and the cleanly scaled icons saved as PNG for that scale level.
Comment 19 khagaroth 2020-05-11 09:00:50 UTC
Please note that my example of badly rendered SVG icons was done at 100% scale - so no Windows scalling involved at all, it's LO that does bad job at rendering the icons (they are already blury in the cache folder). Also your examles are still aliased with burry outlines, though at the bigger sizes it is not so obvious.
Comment 20 V Stuart Foote 2020-05-11 14:05:38 UTC
(In reply to khagaroth from comment #19)
> Please note that my example of badly rendered SVG icons was done at 100%
> scale - so no Windows scalling involved at all, it's LO that does bad job at
> rendering the icons (they are already blury in the cache folder). Also your
> examles are still aliased with burry outlines, though at the bigger sizes it
> is not so obvious.

Icon sets can be found as zip archives in the installation folder share/config folders. Non-SVG icon themes have the icons pre-built as PNG at small 16px, large 24px, extralarge 36px, and a mix at higher res of 32, 48, 96 & 128px

The SVG themes are there also, but presently can not be used natively as SVG in the GUI (bug 115439). When selected enabled, the full SVG theme is extracted and rendered/resampled to PNG at the GUI resolution set.  At 100% the lc_ large icons SVGs are converted to 25px PNG -- the resampled quality simply will not match the resolution of the PNGs packaged at that resolution.

Scaled SVG lc_ icon sizes as PNG after os/DE UI scaling: 
100% 25px
150% 37px
200% 50px
250% 62px

These will be written to LO user cache [1] on creation, but are not refreshed except during an upgrade install (bug 128523). So if testing different icon themes and os/DE UI scaling, will need to clear the cache to force rebuild of the PNG icons.

=-ref-=
[1] that is normally going to be AppData/Roaming/LibreOffice/4/cache for a full install. But with parallel installs it will be relative to the $ORIGIN path you set.
Comment 21 khagaroth 2020-05-12 17:50:06 UTC
I did delete the cache folder when experimenting with it. As I said, the PNGs are already blurry like that in the cache, even at 100% scale.

Disabling OpenGL fixes that though. Disabling Skia in 7 does help as well. The SVG is then identical to the PNG version (at 100%, the scaled resolutions are a different matter). So a GPU code / shader bug?
Comment 22 khagaroth 2020-06-04 16:04:50 UTC
Created attachment 161612 [details]
Comparison of icon rendering in LO 7 beta1 (all at 100%, no scaling)
Comment 23 khagaroth 2020-06-04 16:28:00 UTC
Created attachment 161613 [details]
Comparison of icon rendering in LO 7 beta1 (175%)
Comment 24 V Stuart Foote 2020-06-04 16:35:52 UTC
(In reply to khagaroth from comment #23)
> Created attachment 161613 [details]
> Comparison of icon rendering in LO 7 beta1 (175%)

Yup, the 175% UI scale parses the SVG icons into a new PNG set--if a little smeared, while the scaled PNG gets pixelated--nothing unexpected.

Believe at 175% UI scaling, the SVG is scaled at 150%--next bump is 200% (for 200, 225%), and then 250% (for 250, 275% UI).  So how does Win7 sp1 and you GPU drivers do with the UI at that scale--obviously the PNG would be junk, but with the SVG theme(s)?
Comment 25 khagaroth 2020-06-05 12:12:55 UTC
The 175% case is what I would expect. It's the 100% case that is obviously seriously bugged when using Skia. And these icons aren't even the worst case, there are some icons that are barely visible because they are too thin and extremely blurry. And OpenGL on the current version is even worse.
Comment 26 V Stuart Foote 2020-06-05 13:06:19 UTC
(In reply to khagaroth from comment #25)
> The 175% case is what I would expect. It's the 100% case that is obviously
> seriously bugged when using Skia. And these icons aren't even the worst
> case, there are some icons that are barely visible because they are too thin
> and extremely blurry. And OpenGL on the current version is even worse.

DO NOT USE the SVG icons at scaling less than 150%, they are intended for HIDPI support or when users set a UI scaling > 175%--the PNG icons are intended for use through 150%.
Comment 27 Heiko Tietze 2020-09-05 06:31:03 UTC
Jmux on the ML (might be helpful to track down the issue):

"...So I tested the SVG icons at 100% and the cached PNG version of
breeze_svg/sw/res/emptypage_10x14.svg has the size 11x15 - yikes.

The SVG starts with: <svg viewBox="0 0 14 10" … which means x, y, width,
height. That is not pixel, but AFAIK the stretch related to the output size.

Looking into the problem, still hoping for a simple off-by-one error, I
ended in loadFromSvg

Somewhere in the bowels of XSvgParser::getDecomposition,
Primitive2DReference::getRange and XPrimitive2DRenderer::rasterize, all
the double precision handling eventually results in a rounding error, on
the basis of the bug report, which claims the 24px become 62px at 250%,
instead of 60px 

P.S. "Fun" fact: all the dumped icon ranges / rectangles at 100% scale
start at -13.2292 -13.2292, while none of the values in the SVG are
negative. If you invert that (13.2292 13.2292), you get exactly the one
additional pixel: 13.2292 * 2 * 0.03937 (100th_mmToInch) * 96 (DPI) =
99.99936
So actually I'm not that sure about the rounding error, but suspect some
signed error in XSvgParser::getDecomposition for the viewport. But that
might also be a red hering…"