Bug 389563

Summary: scratchpad zooms using QPainter::SmoothPixmapTransform, which doesn't work for pixel brushes and doesn't give the same result as the canvas
Product: [Applications] krita Reporter: lou
Component: GeneralAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: wishlist CC: griffinvalley, halla, tamtamy.tymona
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot

Description lou 2018-01-28 18:15:32 UTC
Pixel art brush is fuzzy in scratchpad but when used on the real canvas it does behave properly.

See attached screenshot.
Comment 1 lou 2018-01-28 18:16:19 UTC
Created attachment 110185 [details]
screenshot

Missing attached screenshot.
Comment 2 wolthera 2018-01-28 18:26:32 UTC
That's because the scratchpad uses a different zooming method.
Comment 3 lou 2018-01-28 18:28:15 UTC
Is this related to 386019 ? (Is there a way to link to other issues in bugzilla?)

Isn't the only thing that makes sense that the scratchpad should run in a context just like the actual canvas?
Comment 4 Halla Rempt 2018-01-30 09:20:11 UTC
It's not the same thing: bug 386019 is about the difference between painting on an 8 bit paint device and a 16 bit/channel one. This is because the scratchpad doesn't use the canvas code, but renders to a QImage which is then scaled by Qt. 

Putting the full canvas inside the scratchpad would be way too heavy. 

Refactoring that is going to be a future project...
Comment 5 Halla Rempt 2018-01-30 09:22:46 UTC
Note that the CPU canvas also has a different look and feel than the opengl canvas, and for the opengl canvas, there are several scaling options, too.
Comment 6 Tiar 2020-11-03 19:02:13 UTC
I could probably try to fix this to make it use FastTransformation.
Comment 7 Tiar 2021-08-09 15:04:44 UTC
Git commit ee39d3807aa09dacbea70be67f780344d0223a87 by Agata Cacko.
Committed on 09/08/2021 at 15:02.
Pushed by tymond into branch 'master'.

Fix Scratchpad pixel art brushes being not pixel perfect

This commit fixes the scratchpad by ensuring that if the
image inside the scratchpad is scaled up, it uses the Fast
transformation (Nearest Neighbour) instead of smooth transformation
(Bilinear?). That reflects the situation on Krita canvas.

M  +8    -1    libs/ui/widgets/kis_scratch_pad.cpp

https://invent.kde.org/graphics/krita/commit/ee39d3807aa09dacbea70be67f780344d0223a87