Bug 276278

Summary: viewport rendering/anti-aliasing of zoom out
Product: [Applications] krita Reporter: David REVOY <info>
Component: GeneralAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED DUPLICATE    
Severity: normal CC: halla, paulgeraskin
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: same image on my laptop, qpainter canvas
same image 25%, opengl canvas
with an old version
the comparison of old, new-qpainter, new-opengl
the comparison of old, new-qpainter, new-opengl
rendering comparison : Qpainter is blury for line art

Description David REVOY 2011-06-22 19:52:37 UTC
Version:           svn trunk
OS:                Linux

Hi,
The zoom out in Krita display the artwork with really a crispy and aliased rendering. This is annoying working on hi-resolutions pictures or artwork made for be printed. 
To illustrate the problem I did this pictures under, and compared with the other apps I had on my system :
http://david.revoy.free.fr/forums/krita/anti-aa-test/anti-aliasing_compare_deevad.png

the test picture can be downloaded here :
http://david.revoy.free.fr/forums/krita/anti-aa-test/test-picture.png



Reproducible: Always
Comment 1 Halla Rempt 2011-06-22 20:19:56 UTC
Damn! This used to be really good -- http://www.valdyas.org/fading/index.cgi/hacking/krita/progress_2007_2.html. Dmitry, do you have any idea what happened here? It doesn't seem to matter whether I use opengl or qpainter canvas.
Comment 2 Halla Rempt 2011-06-22 20:20:23 UTC
Created attachment 61243 [details]
same image on my laptop, qpainter canvas
Comment 3 Halla Rempt 2011-06-22 20:20:50 UTC
Created attachment 61244 [details]
same image 25%, opengl canvas
Comment 4 Halla Rempt 2011-06-22 21:26:01 UTC
Created attachment 61254 [details]
with an old version
Comment 5 Halla Rempt 2011-06-22 21:29:37 UTC
Around version 2.2 alpha 1 (commit 376aaf72acf2dae518d279aba4cca7ea00a54cce) it was much better, see attachment.
Comment 6 David REVOY 2011-06-22 21:34:04 UTC
Thanks boud for the confirmation and also for the documentation. 
Good job done in 2007. 

Good to see this bug was already solved and in a very good way at this moment. The anti-aliasing looks very good :D This is surely very pleasant to ink comics or practising thin line-art with a display like this on screen. 
I hope it will not be a huge developpement work to move back to 2.2a1 way to display zoom out.
Comment 7 Halla Rempt 2011-06-22 21:35:09 UTC
Direct comparison... http://www.valdyas.org/~boud/comparison_old_new.png

I'm not sure how hard it is to fix the display, unfortunately :-(.
Comment 8 Dmitry Kazakov 2011-06-22 21:40:55 UTC
Created attachment 61255 [details]
the comparison of old, new-qpainter, new-opengl

Just a summary:

version that used to work:
376aaf72acf2dae518d279aba4cca7ea00a54cce -- March 5. 2010

the comparison of old, new-qpainter, new-opengl is in attachement
Comment 9 Dmitry Kazakov 2011-06-22 21:41:03 UTC
Created attachment 61256 [details]
the comparison of old, new-qpainter, new-opengl

Just a summary:

version that used to work:
376aaf72acf2dae518d279aba4cca7ea00a54cce -- March 5. 2010

the comparison of old, new-qpainter, new-opengl is in attachement
Comment 10 Halla Rempt 2011-06-23 12:47:49 UTC
More comparison images at http://www.valdyas.org/~boud/old_canvas_comparison_2.png
Comment 11 David REVOY 2011-06-23 13:00:22 UTC
Cool, thanks to your picture,  I can see Qpainter_mip_map-true does the same job as Photoshop CS2 ( zoom at 400% the PsCs2 picture and compare, same pixels greyed and way to AA  ; http://david.revoy.free.fr/forums/krita/anti-aa-test/anti-aliasing_compare_deevad.png )witch is not optimum compare to what Mypaint and Gimp have . But, it can look good and suffisant ( no PS user complain about it ? they should :D ) . I think Gimp team did a very good job for their AA of viewport, they may be have the best 2D rendering on screen at any zooming. I wonder what is the cost in performance/resources of a rendering like this. May be it has a huge impact on drawing ?

 From the 2007 Krita article about AA Boud linked in this thread ; Krita looked to have even better AA rendering than this. 

For the 3 others, they look to do something a bit better than my actual test with Krita, but still too much crispy.
Comment 12 Halla Rempt 2011-06-23 20:03:10 UTC
Git commit c0282232bc535b3aabffe4bfda6cefdc1db7c256 by Boudewijn Rempt.
Committed on 23/06/2011 at 15:38.
Pushed by rempt into branch 'master'.

KisCanvas: use QImage to scale the patches, not QPainter

QPainter's smooth scaling is much, much worse than QImage's smooth
scaling, so prescale the patch before painting.

The OpenGL canvas is unaffected and still has crap anti-aliasing, but
that's the price of OpenGL.
CCBUG:276278

M  +34   -2    krita/ui/canvas/kis_image_patch.cpp     
M  +8    -0    krita/ui/canvas/kis_image_patch.h     
M  +5    -1    krita/ui/canvas/kis_prescaled_projection.cpp     

http://commits.kde.org/calligra/c0282232bc535b3aabffe4bfda6cefdc1db7c256
Comment 13 Halla Rempt 2011-10-16 13:48:35 UTC
This is as good as it gets -- maybe for 2.5 or so we'll invent a new way of scaling.
Comment 14 David REVOY 2013-02-11 11:30:20 UTC
Created attachment 77125 [details]
rendering comparison : Qpainter is blury for line art
Comment 15 David REVOY 2013-02-11 11:32:23 UTC
I just reopen this one ( check the previous attachment ).
Qpainter is blury for line art, and also the only alternative for Windows users.
Comment 16 Paul Geraskin 2013-05-23 12:41:35 UTC
I also have some comparison to Krita's scale of viewport:
Original image: https://dl.dropboxusercontent.com/u/26887202/blender/kc_buildings_001_castle3_lev122.png

Scale of 66,7%(left is Krita, right is Gimp): https://dl.dropboxusercontent.com/u/26887202/blender/ee1.png

The same is with OpenGL and without.
Comment 17 David REVOY 2013-06-13 22:34:54 UTC
I noticed a negative change lastly ( compiled Git source, nvidia-current on 12.10 'buntu system. Mint KDE 14 )
OpenGL viewport tend to have a very noisy AntiAliasing when 33% zoomed out and lower zoom ( ex : http://i.imgur.com/MovJUDJ.jpg ).
It was quite annoying, as it made me smooth/blur all textures of an artwork on finalising step for nothing ; because I thought they where too noisy or crispy.
Comment 18 Paul Geraskin 2013-06-14 06:35:26 UTC
Hi David, did you try to switch Trilinear filtering on? 
Screeen http://i.imgur.com/I4CGnDC.png

Boud works on different filter types(more sharpen than trilinear). But his new Opengl brunch is still in development and it has some issues with zooming yet.
Comment 19 David REVOY 2013-06-14 09:17:18 UTC
Hi Paul, thanks for the tip ! I never thought to activating 'Trilinear' ; and I have indeed a very good rendering now with it. 
By the past, 'Trilinear' was bugged with my Nvidia driver, and resulted to a lot of slow-down and crunched some wacom input and bring random noise to the line smoothing. I'm happy to see it's not the case anymore.
Comment 20 Paul Geraskin 2013-06-14 09:37:01 UTC
Cool that it helps you!
The problem with Trilinear is that it makes very blurry with zoom less than 70%.  But Boud works on other antializing filters like Nearest-Mipmap. I hope he will commit them too.
Comment 21 David REVOY 2013-09-24 09:24:20 UTC
Update info : I was annoyed back since around 10 days that the canvas get blury again. To get the more sharp rendering back, desactivating 'Trilinear' works. ( tested on Linux ; 2 computers Intel HD2400 and Nvidia GT220 , 3.10 driver ).
Comment 22 Halla Rempt 2013-09-24 09:49:18 UTC
The qpainter canvas rendering hasn't changed at all (unless a Qt upgrade changed some algorithm in there), the opengl canvas rendering changed Sunday evening.
Comment 23 David REVOY 2013-09-24 11:52:49 UTC
Thanks Boud for the infos. I just saw on 'git log' the new work done on OpenGL. I'll update later this week after finishing my production deadlines. ( in comment 21 ; both my computers tested had a Git version from middle of last week , before the update, so my feedback is not related to new OpenGL ).
Comment 24 Halla Rempt 2013-10-24 17:38:07 UTC

*** This bug has been marked as a duplicate of bug 313502 ***