! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Blurry rendering of unscaled backgrounds
Status:
RESOLVED: FIXED
Severity:
trivial
Product:
Xfdesktop
Component:
General

Comments

Description Henk Boom 2007-02-23 03:03:07 CET
Unscaled backgrounds appear slightly blurry. The attached pictures show an image both being used as a background and as viewed in an image editor. In the first one the difference is subtle (but really annoying once you've noticed it), but in the second one I have enlarged a portion of the image so that the difference between the background (on the left) and the original image (on the right) is obvious. 

This seems to be because the image is scaled using a bilinear filter even when it needs no scaling. Attached is a patch which adds code to detect when no scaling is necessary and switch the interpolation to nearest neighbour when appropriate.

Hope this helps,
        Henk Boom
Comment 1 Henk Boom 2007-02-23 03:06:19 CET
Created attachment 1009 
Example of the blurring

The image is shown both in the gimp and as a background. The blurring in this image is subtle, and is most visible on the inner edges of the logo.
Comment 2 Henk Boom 2007-02-23 03:08:53 CET
Created attachment 1010 
A more explicit example

The background image in this example was engineered to exploit the bug. On the right is the image as it appears in GIMP, on the left it is shown as a background. A portion of the image is blown up to show the differences.
Comment 3 Henk Boom 2007-02-23 03:11:30 CET
Created attachment 1011 
A suggested fix

This patch adds code to detect when no scaling is required, and switches to nearest neighbour sampling when appropriate. On top of fixing the bug, this should result in a performance increase when the image does not need scaling.
Comment 4 Brian J. Tarricone (not reading bugmail) 2007-02-25 01:37:11 CET
Personally I'd say the real fix should be in gdk: it should check to see if the image needs to be scaled or not before scaling.  At any rate, patch applied with a few changes and an improvement (just set istyle to _CENTERED if iw==i and ih==i), thanks.

Bug #2939

Reported by:
Henk Boom
Reported on: 2007-02-23
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
1 user

Version

Attachments

Example of the blurring (303.92 KB, image/png)
2007-02-23 03:06 CET , Henk Boom
no flags
A more explicit example (13.27 KB, image/png)
2007-02-23 03:08 CET , Henk Boom
no flags
A suggested fix (569 bytes, patch)
2007-02-23 03:11 CET , Henk Boom
no flags

Additional information