Bug 375824 - Wallpaper image size choice is not optimal
Summary: Wallpaper image size choice is not optimal
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Image Wallpaper (show other bugs)
Version: 5.9.0
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-31 23:55 UTC by Chris Spiegel
Modified: 2020-10-05 20:09 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Spiegel 2017-01-31 23:55:30 UTC
Wallpapers can include many different image resolutions to better match monitor reoslutions.  When choosing which image size to use, an algorithm is used which takes into account both the aspect ratio as well as how much larger or smaller the image is than the monitor resolution.  Smaller images are penalized doubly: an image which is 200 pixels narrower than the desired image is counted the same as an image which is 400 pixels wider.

I believe this algorithm is suboptimal: given a monitor size of 1920x1200, and a wallpaper with two image sizes, 1680x1050 and 2560x1600, the smaller image is chosen even though both have identical aspect ratios to the original.

The problem with this is that upscaling an image looks worse than downscaling an image, as sharpness is inevitably lost.  In plasma-workspace/wallpapers/image/image.cpp, in the function “distance”, the following is the responsible code:

delta = (delta >= 0.0 ? delta : -delta*2 ); // Penalize for scaling up

I think that it's probably better to *always* prefer the larger image if the aspect ratio is the same, but in any case, I think the multiplier here for penalizing upscaling should at least be greater so that images which are somewhat larger, but the same aspect ratio, are prioritized over smaller images of the same aspect ratio.  In my case, a multiplier of 4 is sufficient, so that 2560x1600 is used on my 1920x1200 monitors, but again, I think it's probably better to err a lot on the side of significantly larger images.
Comment 1 Nibaldo G. 2017-02-16 05:14:35 UTC
I was just going to report this bug and I found it. I noticed that the wallpapers look rather blurry.

As an example, if we choose this wallpaper image on a regular monitor, the bug is notorious:
https://kbdevstorage1.blob.core.windows.net/asset-blobs/19027_en_1
Comment 2 Nate Graham 2020-10-05 20:09:30 UTC
This was fixed recently for Plasma 5.20 IIRC.