Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notifications: Images get resized to 48x48px and are thus blurry #2113

Open
The-Compiler opened this issue Mar 27, 2021 · 5 comments
Open

notifications: Images get resized to 48x48px and are thus blurry #2113

The-Compiler opened this issue Mar 27, 2021 · 5 comments
Labels
needs more info Tasks which need more information

Comments

@The-Compiler
Copy link

Description

When an appplication passes a custom icon for a notification, it gets scaled down and is blurry.

Budgie version

10.5.2

Operating system

Solus 4.2

Steps to reproduce the issue

e.g. show a notification with the default settings on https://tests.peter.sh/notification-generator/ via Firefox

Actual result

The website (and Firefox) will pass a 256x256px, but Solus scales it down.
image

Expected result

Icons are used in the original resolution, or at least scaled down to something more sensible (say, 256x256 or so?)

Additional information

https://github.com/solus-project/budgie-desktop/blob/v10.5.2/src/raven/notifications_view.vala#L304

(and also potentially in other places in the same file?)

@JoshStrobl
Copy link
Contributor

Can't say it's that blurry for me when I test it with the 256x256 icon. Are you sure the notification itself is using the scalable or high-resolution icon? That sort of blurriness tends to come from upscaling, not downscaling.

Tested via:

https://tests.peter.sh/notification-generator/#image=1;;icon=https://github.com/qutebrowser/qutebrowser/raw/master/icons/qutebrowser-256x256.png

Not planning on changing it so it displays at a high resolution, happy with the current size of the icon. I did play around with HYPER interpolation instead of BILINEAR for the pixbuf scale option but there was no discernible difference.

@JoshStrobl JoshStrobl added the needs more info Tasks which need more information label Apr 12, 2021
@The-Compiler
Copy link
Author

What seems to be happening is that:

  • I supply a 256x256 icon
  • Budgie scales it down to 48x48px internally (see the link to the code above)
  • It then gets scaled up again from the 48x48px version (instead of just using the original...) for displaying and is thus blurry

Not sure what more information I could provide, though.

JoshStrobl added a commit that referenced this issue Apr 12, 2021
@JoshStrobl
Copy link
Contributor

Our Notification.ui file has it set to 48px and there isn't anywhere we weren't setting the pixel_size to 48. Regardless, I went ahead and changed IconSize.INVALID usage to IconSize.DIALOG which will attempt to get the 48px height version of an icon, and we won't scale if the height we get from data is already 48. You're welcome to validate against the latest commit but still haven't been able to reproduce your issue with the blurry icons, sorry.

@The-Compiler
Copy link
Author

Ah, I suppose this only occurs on High-DPI screens then? My screenshot above is from a 14" laptop with a 2560 x 1440 resolution. I didn't mess with scaling factors or anything, but it looks like Budgie defaulted to scale factor 2.

With that in mind, even if you specify 48 (logical) pixels as size for the icon, it's not safe to assume that the image data should be 48 (device) pixels.

@JoshStrobl
Copy link
Contributor

My desktop is 4K, scaling factor is default of 1x. You do raise a valid point about the scaling factor, will tinker around with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Tasks which need more information
Projects
None yet
Development

No branches or pull requests

2 participants