Change smooth zoom threshold from 200% to 400%
ClosedPublic

Authored by huoni on Apr 24 2018, 2:01 AM.

Details

Summary

At zoom levels >= 200%, scaling changed from smooth to fast, i.e.
actual pixels started showing.
This patch changes it to 400%.

BUG: 270980

Test Plan

Open different sized raster images.
Zoom to at least 400%.
Image should only look pixellated at 400% and higher zooms.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
huoni requested review of this revision.Apr 24 2018, 2:01 AM
huoni created this revision.
huoni added a comment.Apr 24 2018, 2:04 AM

After the discussion in https://bugs.kde.org/show_bug.cgi?id=270980, I thought I'd create this patch to allow others to easily test out a higher value and provide input.

I think 400% is a good threshold, as I don't think <400% zoom is high enough where individual pixels are useful.
When using the scroll wheel, it's actually no different than 300% since the zoom ticks from 283% straight to 400%.

Thoughts?

rkflx accepted this revision.Apr 24 2018, 7:25 AM
rkflx added a subscriber: rkflx.

LGTM. Looks just like the patch on my local branch, which I will now delete (apparently I'm bad at balancing reviews against submitting patches…).

I'll spare you the detailed reasoning in my commit message, but FWIW here are some sample shots I already prepared:



As you can see, the limit results from trying to make it look good for different content types, which have different requirements (e.g. photo vs. icon). 400% is the right limit, IMO, and incidentally scaling up with factor 4 is an "exact" operation, making it look very sharp for that threshold.

As for the zoom buttons: Don't forget that using the slider you have more fine grained control over the zoom level.

This revision is now accepted and ready to land.Apr 24 2018, 7:25 AM
huoni added a comment.Apr 24 2018, 8:11 AM

LGTM. Looks just like the patch on my local branch, which I will now delete (apparently I'm bad at balancing reviews against submitting patches…).

Ah, sorry for butting in ahead of you!

I'll spare you the detailed reasoning in my commit message, but FWIW here are some sample shots I already prepared:



As you can see, the limit results from trying to make it look good for different content types, which have different requirements (e.g. photo vs. icon). 400% is the right limit, IMO, and incidentally scaling up with factor 4 is an "exact" operation, making it look very sharp for that threshold.

Our patches must be slightly different. Mine switches to pixels at 400%, whereas your screenshots suggest that it's still using smooth scaling at 400%. Did you change yours to <= perhaps for the screenshots? Maybe it wasn't intentional, given you are mentioning the exact 4x scaling.

As for the zoom buttons: Don't forget that using the slider you have more fine grained control over the zoom level.

I didn't forget, but most people (I admittedly assume) would use the scroll wheel, which is why I mentioned it.

rkflx added a comment.EditedApr 24 2018, 8:19 AM

Our patches must be slightly different. Mine switches to pixels at 400%, whereas your screenshots suggest that it's still using smooth scaling at 400%. Did you change yours to <= perhaps for the screenshots? Maybe it wasn't intentional, given you are mentioning the exact 4x scaling.

My patch was for < 400%, but the screenshots were captured without any limit (sorry, should've mentioned this – good eye, though!). This was because I was experimenting to find the best limit, so I was setting even numbers, obviously, and not 399% ;) I just wanted to see how smoothing looked in the region of 350% to 450% zoom. Only after finding that approximate limit, I started reasoning about the exact limit, but did not recreate the screenshot. Using < instead of <= is the way to go, though, for the exact scaling mentioned.

Edit: To clarify: I simply used two versions of Gwenview: One without smoothing, and one with smoothing, and then I compared at different zoom levels and for different content types.

Very nice! +1

This revision was automatically updated to reflect the committed changes.