Bug 411262 - Downscaling issues in Icons with Preview Mode enabled
Summary: Downscaling issues in Icons with Preview Mode enabled
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Thumbnails and previews (show other bugs)
Version: 17.12.3
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-25 06:24 UTC by hoperidesalone
Modified: 2020-01-16 17:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.04


Attachments
downscaling comparison image (208.43 KB, image/png)
2019-08-25 06:24 UTC, hoperidesalone
Details
image one (17.78 KB, image/jpeg)
2019-08-25 06:24 UTC, hoperidesalone
Details
image two (65.21 KB, image/jpeg)
2019-08-25 06:25 UTC, hoperidesalone
Details
image three (71.84 KB, image/jpeg)
2019-08-25 06:25 UTC, hoperidesalone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hoperidesalone 2019-08-25 06:24:23 UTC
Created attachment 122333 [details]
downscaling comparison image

SUMMARY
Downscaling method used in Dolphin is quite lacking and makes the images too pixel-y/sharp, for the lack of better word.

STEPS TO REPRODUCE
1. Find an image with 4:3 aspect ratio (I've added 3 in attachments, you can download there)
2. Switch to Icon view mode and enable Preview, increase preview size to 256px

OBSERVED RESULT
Relatively jarring downscaling.

EXPECTED RESULT
Better downscaling regarding image previews.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 18.04.2 LTS x86_64
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5 (built against 5.9.5)

ADDITIONAL INFORMATION
Images in the bottom have been downscaled to 256px in Nomacs with Area downscale. Also, this issue was the most observable in images with 4:3 aspect ratio but I'm not sure if it's limited to that.
Comment 1 hoperidesalone 2019-08-25 06:24:58 UTC
Created attachment 122334 [details]
image one
Comment 2 hoperidesalone 2019-08-25 06:25:19 UTC
Created attachment 122335 [details]
image two
Comment 3 hoperidesalone 2019-08-25 06:25:36 UTC
Created attachment 122336 [details]
image three
Comment 4 Wktradewell 2020-01-14 00:34:48 UTC
Also an image for me. Does not matter the resolution of the image, and it's more obvious on some items than others. JPEG thumbnailing looks to be done completely separately from all other common image formats. As a consequence, it does not look like it goes through the same downscale process as other common image formats. And as a result, it tends to look... bad. In images where the resolution is a multiple of the current icon size (512x512 icon of a 1024x1024 image), the thumbnail appears correct, there is none of the mentioned artifacting. It appears that instead of a simple cubic downscale, the JPEG thumbnailer doesn't interpolate at all. Hence, the ugly thumbnails for anything that's not... thumbnail sized. As far as I can tell, this is reproducible across all versions of kde, and is problematic with most images.
Comment 5 Wktradewell 2020-01-14 00:37:45 UTC
Another note: On many types of images, such as photographs without sharp contrast or screenshots, the artifacts are typically hard to notice. Furthermore, it doesn't seem to be the kind of problem that bothers most people enough to report. It would, however, be nice if it got fixed somehow. I'll probably take a crack at it myself, but I am... inexperienced.
Comment 6 Wktradewell 2020-01-14 01:39:09 UTC
I downloaded the kio-extra source, and took a peek. And fixed it. Uh, no idea how to submit the fix, but I have it. I will figure it out. In the mean time, it looks like when the thumbnail was being created, the quality of the thumbnailer (I assume the scaler) was being set to 0. Setting it to 100 resolves the issue, with no notable performance impact (at least, subjectively). This makes me feel silly.
Comment 7 hoperidesalone 2020-01-14 02:45:23 UTC
(In reply to Wktradewell from comment #6)
> I downloaded the kio-extra source, and took a peek. And fixed it. Uh, no
> idea how to submit the fix, but I have it. I will figure it out. In the mean
> time, it looks like when the thumbnail was being created, the quality of the
> thumbnailer (I assume the scaler) was being set to 0. Setting it to 100
> resolves the issue, with no notable performance impact (at least,
> subjectively). This makes me feel silly.

Glad to see someone else other than me also has an issue with this as well, I was losing hope that it'd get noticed. Thanks for fixing it, hopefully the patch lands in kio-extra as soon as possible. :)
Comment 8 Nate Graham 2020-01-16 17:17:36 UTC
Git commit b18be2ed1a80d951977e359f57bf3b5c82fb526a by Nate Graham, on behalf of William Tradewell.
Committed on 16/01/2020 at 17:17.
Pushed by ngraham into branch 'master'.

Improved quality of JPEG thumbnails

Summary:
FIXED-IN: 20.04

Simple tweak to increase quality of JPEG thumbnails. For some reason the thumbnailer was set to scale them down at the minimum possible quality, and this led to some rather ugly results. This is, of course, no longer the case. See the attached images for a comparison. The image was created in gimp, and shows a near worst-case for the thumbnailer before the fix.

Before:
{F7882034}

After:
{F7882035}

Reviewers: broulik, #frameworks, #vdg, cfeck, ngraham

Reviewed By: #vdg, cfeck, ngraham

Subscribers: meven, volkov, cfeck, bruns, ngraham, kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D26648

M  +1    -1    thumbnail/jpegcreator.cpp

https://commits.kde.org/kio-extras/b18be2ed1a80d951977e359f57bf3b5c82fb526a