Bug 443010 - Consider always using Qt::SmoothTransformation, or allow configuring it in settings
Summary: Consider always using Qt::SmoothTransformation, or allow configuring it in se...
Status: CONFIRMED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 21.08.1
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Nate Graham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-27 12:57 UTC by Frederick Zhang
Modified: 2023-06-28 10:06 UTC (History)
7 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 Frederick Zhang 2021-09-27 12:57:46 UTC
SUMMARY
Because of [1], Qt::FastTransformation is always used when zooming in.
As much as I understand that it provides a more accurate pixel
representation, resulting images often don't look as nice as they do in
other programs, e.g. Firefox.

Personally I'd argue that as a general purpose image viewer, Gwenview
should prefer quality (visually) to accuracy. But if the maintainers
don't like this idea, I'd really appreciate it to at least make it
configurable.

[1] https://invent.kde.org/graphics/gwenview/blob/9d753ca3ffce6792db59317505499a5f33c3e2e1/lib/documentview/rasterimageitem.cpp#L119-122
Comment 1 cantabile 2021-12-06 14:50:36 UTC
+1 for SmoothTransformation. I zoom in to make a smaller image as big as the screen, so I don't have to squint at it. The nearest neighbour scaling is useless for that.

// We want nearest neighbour when zooming in since that provides the most
// accurate representation of pixels,

I am very curious about these „we”. Who are they and what do they do that requires this super accurate representation?
Comment 2 Nate Graham 2021-12-06 16:44:05 UTC
I agree.
Comment 3 Nate Graham 2021-12-06 16:46:49 UTC
Or maybe it should automatically use smooth but switch to fast beyond a certain zoom level. At high zoom, seeing the individual pixels is probably what you want, rather than a big blurry mess.
Comment 4 Bug Janitor Service 2021-12-06 16:58:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/122
Comment 5 Nate Graham 2021-12-08 17:10:03 UTC
Git commit 4e26fe2ccf2701fac9972e52d0507ea1121f0b95 by Nate Graham.
Committed on 07/12/2021 at 17:38.
Pushed by ngraham into branch 'master'.

Only switch to Qt::FastTransformation ("showing pixels") at 500% zoom

Right now Gwenview uses Qt::FastTransformation to show individual pixels
at any zoom value higher than 100%. This is not optimal and results in
poor display for low zoom levels where a smoothed image is more
aesthetically desirable. But there are use cases for seeing individual
pixels--for example when looking at the details of a line-art graphic
or an icon, or examing an image to see its individual colors. These use
cases becomes more likely as the zoom level is increased.

Accordingly, this commit changes Gwenview to shop smoothing zoomed-in
images at an arbitrarily-chosen threshold of 400% zoom. At that level or
above, the image will be unsmoothed and you can see the individual
hard-edged pixels.
FIXED-IN: 22.04

M  +5    -4    lib/documentview/rasterimageitem.cpp

https://invent.kde.org/graphics/gwenview/commit/4e26fe2ccf2701fac9972e52d0507ea1121f0b95
Comment 6 Jens Ramke 2021-12-11 12:31:29 UTC
Can you please make this configurable?
I am using Gwenview sometimes for multiple hours a day to compare images at multiple zoom levels (mainly 100%, 200%, 400% and 800%).
I need to see individual pixels to do an accurate comparison.
Comment 7 popov895 2021-12-11 14:31:06 UTC
(In reply to Jens Ramke from comment #6)
> Can you please make this configurable?

+1. 

(In reply to cantabile from comment #1)
> I am very curious about these „we”. Who are they and what do they do that
> requires this super accurate representation?

I'm one of them.
Comment 8 Nate Graham 2021-12-12 23:50:58 UTC
So with the above commit, smoothing is now automatic until 400% zoom, at which point you will see the individual pixels. Are folks saying they have use cases where it would be useful to see the raw pixels at 101-399% zoom as well?
Comment 9 Jens Ramke 2021-12-13 00:11:23 UTC
(In reply to Nate Graham from comment #8)
> Are folks saying they have
> use cases where it would be useful to see the raw pixels at 101-399% zoom as
> well?

Yes, I do use 200% zoom quite a bit and I need to see an unfiltered image.
Comment 10 Nate Graham 2021-12-13 03:56:21 UTC
OK. I can look into adding a configurable option for this. It does seem like the kind of think that could be subjective. I'll keep the default point at which it switches from smoothing to raw pixels at 400% though. But you'll be able to change it.
Comment 11 Karl Ove Hufthammer 2023-06-28 10:06:02 UTC
(In reply to Jens Ramke from comment #9)
> (In reply to Nate Graham from comment #8)
> > Are folks saying they have
> > use cases where it would be useful to see the raw pixels at 101-399% zoom as
> > well?
> 
> Yes, I do use 200% zoom quite a bit and I need to see an unfiltered image.

Me too. An unfiltered/non-smoothed view is very important when viewing pixel art. (It would also be nice with a shortcut to quickly switch between a smoothed and non-smoothed view.)