Created attachment 130754 [details] Source used for scaling attempts SUMMARY There currently is the inherent issue of having blurred results when using fractional scaling. However, there are better and worse algorithms for that. Also one might think about completely moving away from simply scaling things up and use pixel perfect graphics, maybe derived from svg graphics instead. I did some short test with GIMP and different algorithms for upscaling. See the attachements. It is clearly visible that NoHalo and LoHalo reduce the blurriness in comparison to Cubic or Linear. I don't know which algorithm is currently used, but there might be potential for improvement there. I might have filed this for the wrong product, please check, whether this is correct.
Created attachment 130755 [details] No algorithm for scaling selected
Created attachment 130756 [details] Linear algorithm
Created attachment 130757 [details] Cubic algorithm
Created attachment 130758 [details] NoHalo algorithm
Created attachment 130759 [details] LoHalo algorithm
More general comparison and background: - https://en.wikipedia.org/wiki/Comparison_gallery_of_image_scaling_algorithms - https://en.wikipedia.org/wiki/Pixel-art_scaling_algorithms#/media/File:Pixel-Art_Scaling_Comparison.png - https://en.wikipedia.org/wiki/Image_scaling
This might be done at the Qt level, in fact. But I'll let the KWin developers give you the truth since that's just speculation. :)
Is this with Wayland? KWin on X11 doesn't scale.
There is no upscaling. If there is you've got a different bug. Please check
(In reply to Christoph Feck from comment #8) > Is this with Wayland? KWin on X11 doesn't scale. Yes this is on Wayland. As I said, this is about fractional scaling set in the view settings. KWin might be the wrong product to file this. (In reply to David Edmundson from comment #9) > There is no upscaling. If there is you've got a different bug. Please check So when applying fractional scaling, say a factor of 1.25 the icons, mouse cursor etc. are not upscaled?
(In reply to Claudius Ellsel from comment #10) > So when applying fractional scaling, say a factor of 1.25 the icons, mouse > cursor etc. are not upscaled? They are rendered at 2-times the normal size and then downscaled. That's the theory, in practice there can always be issues. I believe sometimes Qt Wayland clients do not update their size when changing the scale factor. And then there is of course Xwayland.
(In reply to Roman Gilg from comment #11) > (In reply to Claudius Ellsel from comment #10) > > So when applying fractional scaling, say a factor of 1.25 the icons, mouse > > cursor etc. are not upscaled? > > They are rendered at 2-times the normal size and then downscaled. That's the > theory, in practice there can always be issues. Do you mean upscaled? A factor of 1.25 increases the size of the icons. This was my whole question, as David Edmundson stated there wouldn't be upscaling. > I believe sometimes Qt Wayland clients do not update their size when > changing the scale factor. And then there is of course Xwayland. The size is updated properly, only they are blurred. This is what this issue is about.
I said the specific thing in your screenshot shouldn't be upscaled. If fractional scaling was applied that could result in a downscale of the original client texture.
David, I think Claudius is using the term "scaling" as a user understands the term, not as a KWin developer understands the term. Looking at the attachments, clearly there are differences in the different ways that images can be scaled up. Knowing that fractional scaling downscales from a doubled pixel-perfect version, it might be interesting to repeat the tests with downscaled images.
(In reply to Nate Graham from comment #14) > David, I think Claudius is using the term "scaling" as a user understands > the term, not as a KWin developer understands the term. Looking at the > attachments, clearly there are differences in the different ways that images > can be scaled up. Knowing that fractional scaling downscales from a doubled > pixel-perfect version, it might be interesting to repeat the tests with > downscaled images. Ah, I see my mistake now. Roman Gilg already pointed that out, but I did not understand it then. I just assumed it would be scaled up. Downscaling obviously is the better approach to implementation, since no information has to be interpolated, so that makes sense. This renders the different algorithm comparisons I posted rather pointless. However, I read the the NoHalo algorithms were actually developed for downscaling in particular and that blurriness can also happen when scaling down. So the general idea that there might be better algorithms still seems to be valid.
Alright, I have done some testing with the downscaling from a 2x version (took a screenshot on X11 with that scale factor, had to manually double the size of the panel, too). Did not work to take that screenshot on Wayland due to https://bugs.kde.org/show_bug.cgi?id=425226. I tested Linear against NoHalo scaling the version down by a factor of roughly 0.6 and there is almost no noticeable difference. So it seems that downscaling works good in this use case pretty much regardless of which algorithm is used. The reason why I opened this was https://bugs.kde.org/show_bug.cgi?id=408215. This might have a different root cause, though. Also there is a noticeable blurred notification tray icon in the panel on Wayland with fractional scaling applied. This might also be related to some different root cause, though. Unfortunately, due to https://bugs.kde.org/show_bug.cgi?id=425226 I cannot create a screenshot depicting the problem.
Created attachment 130785 [details] Original used for downscaling
Created attachment 130786 [details] Downscaling with linear algorithm
Created attachment 130787 [details] Downscaling with NoHalo algorithm
Interesting comparison. Linear looks to me even better. Might there be other algorithms improving upon that though?
(In reply to Roman Gilg from comment #20) > Interesting comparison. Linear looks to me even better. Might there be other > algorithms improving upon that though? Yes, there might. Although from what I read NoHalo in GIMP already seems to do a pretty decent job for most cases (https://www.gimpusers.com/system/tutorial_steps/3061/sampling-original.jpg), although that might not cover the special use case of KDE. There seems to have also been a LoBlur algorithm be planned for GIMP (https://www.gimpusers.com/tutorials/whats-new-in-gimp-2-10 point 4) in 2012, which is not available today. Since GIMP is probably only using known approaches, there might be already at least theoretical algorithms out there for this use case. Also another reference for the NoHalo algorithm in GIMP: http://libregraphicsworld.org/blog/entry/advanced-samplers-for-gegl-to-be-crowdfunded
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Setting back to "reported" as I think I provided all required information. Did not know that I am supposed to change the state myself and did not want to come off rude by changing it.
> Linear looks to me even better. I believe both Mutter and Sway use linear but fallback to nearest for the special case of integer scaling (see [1] and [2]). xrandr uses bicubic (although that can be changed to nearest [3]). I haven't done a side-by-side comparison, but I find all of them work rather fine compared to how tray icons scale in Plasma panel. We are probably seeing upscaling there and I suppose there are no handcrafted 2x icons to downscale from. Cludius: I don't understand your second experiment quite well. When you upscaled x2 you just took the small icons and duplicated everything? If that's the case, it might be worth for comparative purposes but I don't think as a scaling technique that would improve too much on plain upscaling, since it's not adding any new information (like, say, a handcrafted version or an upscaled svg version). --- [1] https://github.com/swaywm/wlroots/issues/1770 [2] https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/845 [3] https://www.reddit.com/r/GPDPocket/comments/90bras/tip_nearestneighbor_xrandr_display_scaling/
(In reply to Carlos from comment #24) > Cludius: I don't understand your second experiment quite well. When you > upscaled x2 you just took the small icons and duplicated everything? If > that's the case, it might be worth for comparative purposes but I don't > think as a scaling technique that would improve too much on plain upscaling, > since it's not adding any new information (like, say, a handcrafted version > or an upscaled svg version). You mean my first experiment? I upscaled in the first series and for the second series I downscaled (after learning that icons are at least in theory only downscaled), both times starting with (I think) a screenshot of a desktop with 1x or 2x scale factor respectively. The tray icons in the second approach's 2x source are just looking that small originally. Does that help?
QtWayland now has native fractional sacling, we don't need to do workarounds at a kwin level