Bug 267584 - JPEG pictures scaled smoothly while PNGs show pixelation
Summary: JPEG pictures scaled smoothly while PNGs show pixelation
Status: RESOLVED WORKSFORME
Alias: None
Product: gwenview
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 21:41 UTC by Kai Uwe Broulik
Modified: 2020-12-20 04:34 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
different anti aliasing methods (863.48 KB, image/png)
2011-03-03 21:41 UTC, Kai Uwe Broulik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2011-03-03 21:41:56 UTC
Created attachment 57657 [details]
different anti aliasing methods

Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

When looking at a huge picture (a screenshot of my desktop: 7126x1200) in different formats (here: JPEG and PNG) you can see differences in the anti aliasing when those are set to fit the screen.
The JPEG is scaled smoothly (using lanczos?) while the PNG shows pixelation, especially visible on the desktop icon names.

Reproducible: Always
Comment 1 Christoph Feck 2011-03-03 22:44:33 UTC
JPEG scaling is done by decompressing a lower resolution, which is automatically smoothed because of the way JPEG works. For example, when loading a 1024x1024 image at a size of 128x128 pixels, each pixel in the scaled image is the computed average of a block of 8x8 pixels from the original image.

The smooth scaling algorithms in Qt only use 4 (2x2) pixels to compute each pixel of the scaled image, so it looks worse than JPEG. This also means the "bug" can only been seen when the scaling factor is smaller than 1:2.

I doubt a viewer should use a (much slower but) higher quality downscaling algorithm than what is offered by Qt. Maybe it could optionally use QImageBlitz, which has some 9- and 25-point filters, or it could use multiple downscaling steps when the scaling factor is less than 1:2. A good way would be to iteratively half the image size using [1], then as a last step use the Qt smooth scaling algorithm to get the final scaled size.

[1] http://labs.qt.nokia.com/2009/01/20/50-scaling-of-argb32-image/
Comment 2 Kai Uwe Broulik 2011-03-03 22:46:19 UTC
Okay, just a minor thing. Thanks for the info, didn‘t know. Feel free to close as invalid or whatever. Or leave it open if you wish to.
Comment 3 Christoph Feck 2017-11-15 23:07:53 UTC
Updated link: http://blog.qt.io/blog/2009/01/20/50-scaling-of-argb32-image/
Comment 4 Nate Graham 2017-11-16 03:25:50 UTC
Should we close this, or is there anything we can reasonably do here?
Comment 5 Justin Zobel 2020-11-20 04:50:51 UTC
As per Nate's Comment 4 can this now be closed or is further work needed?
Comment 6 Bug Janitor Service 2020-12-05 04:33:56 UTC
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!
Comment 7 Bug Janitor Service 2020-12-20 04:34:31 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!