Bug 144583 - Blurry icon on HiDPI
Summary: Blurry icon on HiDPI
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0 target:7.4.2
Keywords:
Depends on:
Blocks: HiDPI
  Show dependency treegraph
 
Reported: 2021-09-18 08:44 UTC by Paul Menzel
Modified: 2022-11-08 16:31 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Blurry toolbar icons (72.29 KB, image/png)
2022-09-13 12:15 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Menzel 2021-09-18 08:44:30 UTC
Description:
Using Debian sid/unstable with LibreOffice 7.2.1-1 (and GNOME), the icons are blurry on a HiDPI screen. This is *not* a regression.

A similar bug is in Ubuntu’s bug tracker [1].

[1]: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1750199

Steps to Reproduce:
1.  Start LibreOffice on a HiDPI screen

Actual Results:
Notice blurry icons.

Expected Results:
Sharp icons.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.1.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 4; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Debian package version: 1:7.2.1-1
Calc: threaded
Comment 1 Heiko Tietze 2021-09-19 08:19:33 UTC
Tools > Options > View let you pick different themes and icon sizes. Guess you use Elementary and Automatic but please try the SVG variant.
Comment 2 Paul Menzel 2021-09-21 16:08:54 UTC
(In reply to Heiko Tietze from comment #1)
> Tools > Options > View let you pick different themes and icon sizes. Guess
> you use Elementary and Automatic but please try the SVG variant.

*Elementary (SVG)* is selected.
Comment 3 tothesong 2022-04-05 04:00:39 UTC
I can reproduce this on Arch Linux and Gnome 41 Wayland with my 13-inch 2K laptop:

Version: 7.3.2.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 16; OS: Linux 5.17; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: en-US
7.3.2-1
Calc: threaded

The non-SVG version is a bit blurry as expected, but the SVG version blurry even more, which is annoying.
Comment 4 Hossein 2022-09-13 12:15:26 UTC
Created attachment 182408 [details]
Blurry toolbar icons

I can reproduce this issue, as I use HiDPI display with 2x scaling on Ubuntu 22.04.

I use this icon theme: Breeze (SVG + Dark)

Toolbar icons look blurry in 7.4:

Version: 7.4.0.3 / LibreOffice Community
Build ID: f85e47c08ddd19c015c0114a68350214f7066f5a
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: fa-IR (en_US.UTF-8); UI: en-US
Calc: threaded

And also in the latest dev master 7.5:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: c0d09eb46665a0b2ab86f263cc95662f406d83d2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 Hossein 2022-09-13 13:19:49 UTC
@Caolan
I think this is related to the way icons are rasterized and get rendered. If someone uses a 2x scaling, the underlying rasterizer does the rasterization for a smaller size, and the result becomes blurry.
Do you have any idea how to draw vectors better in vcl/gtk?
Comment 6 V Stuart Foote 2022-09-13 17:31:56 UTC
(In reply to Hossein from comment #5)
> @Caolan
> I think this is related to the way icons are rasterized and get rendered. If
> someone uses a 2x scaling, the underlying rasterizer does the rasterization
> for a smaller size, and the result becomes blurry.
> Do you have any idea how to draw vectors better in vcl/gtk?

@Hossein, *
So please check the cache in your user profile. With a 200% scaling you should see a breeze_svg directory and sub-directory "200" that should contain the entire Breeze icon theme resampled to PNG icons at ~64x64px.  If used those should be very crisp.

If not there then the icons are not being rebuilt and some lower resolution 32px icons are simply being scaled 200% with other UI graphics.

See also bug 115439
Comment 7 Paul Menzel 2022-09-13 17:42:36 UTC
I am still experiencing this with *libreoffice* 1:7.4.1~rc2-3 from Debian sid/unstable.

Strange, that these cache files are created for each user, but here you go:

    $ file /home/user/.config/libreoffice/4/cache/elementary_svg/200/sc/res/dropurl.png
    /home/user/.config/libreoffice/4/cache/elementary_svg/200/sc/res/dropurl.png: PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
Comment 8 Hossein 2022-09-13 19:40:58 UTC
This is the result from my system:

$ file ~/.config/libreoffice/4/cache/breeze_dark_svg/200/res/*.png
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/mainapp_48_8.png:                 PNG image data, 98 x 98, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/minus.png:                        PNG image data, 24 x 24, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odb_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odf_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odg_16_8.png:                     PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odg_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odp_16_8.png:                     PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odp_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odp_48_8.png:                     PNG image data, 98 x 98, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/ods_16_8.png:                     PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/ods_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/ods_48_8.png:                     PNG image data, 98 x 98, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odt_16_8.png:                     PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odt_32_8.png:                     PNG image data, 66 x 66, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/odt_48_8.png:                     PNG image data, 98 x 98, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/plus.png:                         PNG image data, 24 x 24, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/recentdoc_remove_highlighted.png: PNG image data, 50 x 50, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/recentdoc_remove.png:             PNG image data, 50 x 50, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/reload.png:                       PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03123.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03139.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03150.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03162.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03245.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03246.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03247.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03248.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03249.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03250.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03251.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
/home/hossein/.config/libreoffice/4/cache/breeze_dark_svg/200/res/sx03255.png:                      PNG image data, 34 x 34, 8-bit/color RGBA, non-interlaced
Comment 9 V Stuart Foote 2022-09-13 20:08:21 UTC
(In reply to Hossein from comment #8)
> This is the result from my system:
> 
> $ file ~/.config/libreoffice/4/cache/breeze_dark_svg/200/res/*.png

So the SVG *are* being resampled and scaled 200% into a new set of scale appropriate PNG icons correctly, but then are not being used by the DE as the UI is scaled.
Comment 10 Caolán McNamara 2022-09-14 15:56:32 UTC
https://gerrit.libreoffice.org/c/core/+/139944 + 
https://gerrit.libreoffice.org/c/core/+/139945
give me good results
Comment 11 Commit Notification 2022-09-14 18:35:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cc2a6787446f1ae6492a41c405f45a9cc8cc7d4e

Related: tdf#144583 move current lok hidpi icon thing into SalGraphics

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2022-09-14 20:20:07 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ce4e3d6f39cb4db138ff2445b27d7af7ad01ff33

Resolves: tdf#144583 reuse lok hidpi icon scheme for gtk

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Hossein 2022-09-14 21:41:04 UTC
(In reply to Caolán McNamara from comment #10)
> https://gerrit.libreoffice.org/c/core/+/139944 + 
> https://gerrit.libreoffice.org/c/core/+/139945
> give me good results

Thank you for the quick fix, Caolán!

It worked fine for me on HiDPI and 2x integer scaling, after you have merged the above two patches:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: d480af79c6d67341e650a5b920bf66c2865309e0
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Note: I haven't tested the fixes extensively with fractional scaling.
Comment 14 Caolán McNamara 2022-09-15 08:05:47 UTC
Seeing as the original report was with svg lets call this fixed then, and backport to 7-4 is in gerrit. Maybe for the png case it would be nicer to have the pngs available in different sizes to begin with so a suitable size would be available rather than upscaling a smaller one, or maybe svg only is the right way to go eventually.
Comment 15 Hossein 2022-09-15 08:38:25 UTC
Verifying the fix with the above commits, as I described in comment 13.

I think sticking to SVG is the better approach, because of the use of fractional scaling leads to multiple/unknown icon sizes.
Comment 16 Commit Notification 2022-09-16 20:57:14 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/c062358d7b58ce3a9b27681040d854ec7ea1868b

Resolves: tdf#144583 reuse lok hidpi icon scheme for gtk

It will be available in 7.4.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.