Summary: | Clipboard brush is aliased when painting on a rotated canvas | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Paul Geraskin <paulgeraskin> |
Component: | Brush engines | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dimula73, ghevan, halla, lukast.dev |
Priority: | NOR | ||
Version: | git master (please specify the git hash!) | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | http://commits.kde.org/calligra/896ba64f39f53adc9e56efbe0070cd40e206026e | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Brush blur |
Description
Paul Geraskin
2013-05-17 11:49:50 UTC
Also, use your mouse for testing. Or switch size and opacity off for pen pressure. Created attachment 79937 [details]
Brush blur
I can confirm this bug. No modifiers applied, and brush tip had no scale in it.
It seems the bug is related on how the data is transfer to the canvas as the pixelation varies depending on a small threshold. That's what I try to show at the top. I try to align the shape pixel grid to the canvas layer grid without success.
On pixel perfect brushes the effect is very evident even at normal zoom.
Confirming in git master. We used to do mip-mapping for bitmap brush masks but it was removed (hint to search in git log:slangkamp iirc) to improve performance without side effect. I'm wondering if this is the side effect or not. Git commit b9d749eb4e7c6bbc00332c9d1c090c9a2293af74 by Dmitry Kazakov. Committed on 16/07/2013 at 10:43. Pushed by dkazakov into branch 'master'. A significant refactoring in the Predefined Brush engine This patch ports the predefined brush engine to the new capabilities of Qt. It removes a huge chunk of hand-written code. Here is a short list of changes: 1) All the operations are now performed on non-premultiplied RGB values. The use of premultiplication resulted in instability of the color, which caused artifacts on scaling and rotation of the brushes. 2) Trilinear filtering of the brushes is now substituted with simple bilinear filtering from the nearest pyramid level. It turned out that trilinear filtering not only impacted the performance, but also introduced heavy aliasing artifacts on specific zoom levels. 3) After the patch the speed of the dab generation raised 3-5 times. Here are the values for 512px brush: Before patch: Scaling: 34 ms Rotation: 19 ms After patch: Scaling: 6 ms Rotation: 9 ms Related: bug 320368, bug 300665, bug 320651 CCMAIL:kimageshop@kde.org M +1 -2 krita/plugins/paintops/libbrush/CMakeLists.txt M +0 -1 krita/plugins/paintops/libbrush/kis_abr_brush.cpp M +1 -1 krita/plugins/paintops/libbrush/kis_auto_brush.cpp M +70 -778 krita/plugins/paintops/libbrush/kis_brush.cpp M +3 -26 krita/plugins/paintops/libbrush/kis_brush.h M +2 -3 krita/plugins/paintops/libbrush/kis_gbr_brush.cpp D +0 -135 krita/plugins/paintops/libbrush/kis_qimage_mask.cpp D +0 -138 krita/plugins/paintops/libbrush/kis_qimage_mask.h A +196 -0 krita/plugins/paintops/libbrush/kis_qimage_pyramid.cpp [License: GPL (v2+)] A +52 -0 krita/plugins/paintops/libbrush/kis_qimage_pyramid.h [License: GPL (v2+)] D +0 -64 krita/plugins/paintops/libbrush/kis_scaled_brush.cpp D +0 -62 krita/plugins/paintops/libbrush/kis_scaled_brush.h A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_0_sc_0.871853_rot_3.55731_sub_0.137199.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_1_sc_0.861342_rot_3.45867_sub_0.20933.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_2_sc_1.80941_rot_4.97706_sub_0.113862.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_3_sc_0.46124_rot_4.18791_sub_0.167627.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_4_sc_0.963137_rot_2.82314_sub_0.444059.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_5_sc_0.592981_rot_0.439579_sub_0.45074.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_6_sc_1.86775_rot_3.12606_sub_0.365777.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_7_sc_1.13937_rot_3.47854_sub_0.458733.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_8_sc_1.53198_rot_3.68719_sub_0.410264.png A +- -- krita/plugins/paintops/libbrush/tests/data/brush_masks/_brush_9_sc_1.46566_rot_2.88023_sub_0.474873.png M +- -- krita/plugins/paintops/libbrush/tests/data/result_autobrush_3.png M +- -- krita/plugins/paintops/libbrush/tests/data/result_autobrush_4.png A +- -- krita/plugins/paintops/libbrush/tests/data/testing_brush_512_bars.gbr M +24 -28 krita/plugins/paintops/libbrush/tests/kis_auto_brush_test.cpp M +91 -17 krita/plugins/paintops/libbrush/tests/kis_brush_test.cpp M +7 -2 krita/plugins/paintops/libbrush/tests/kis_brush_test.h M +5 -4 krita/plugins/paintops/libbrush/tests/kis_imagepipe_brush_test.cpp http://commits.kde.org/calligra/b9d749eb4e7c6bbc00332c9d1c090c9a2293af74 Git commit fac079a40168ea93da50d2951430b07a8a2a9b0f by Dmitry Kazakov. Committed on 17/07/2013 at 07:56. Pushed by dkazakov into branch 'master'. Properly fix the blurred brushes bug There should be a small fuzzyness when searching for a proper zoom level M +7 -1 krita/plugins/paintops/libbrush/kis_qimage_pyramid.cpp M +3 -1 krita/plugins/paintops/libbrush/kis_qimage_pyramid.h M +37 -1 krita/plugins/paintops/libbrush/tests/kis_brush_test.cpp M +1 -0 krita/plugins/paintops/libbrush/tests/kis_brush_test.h http://commits.kde.org/calligra/fac079a40168ea93da50d2951430b07a8a2a9b0f Now it works cool. But if I rotate canvas i get such an issue with antialising http://i.imgur.com/xwWlniw.png Can you check it? Just rotate canvas... Hm, I need to check that... This happens because Clipboard brush uses exactBounds() and crops the transparent pixels on the border. Later, when doing transformations, the pixels are not filtered, because there are no transparent pixels to blend with. There may be two options to solve the issue: 1) Add a workaround to clipboard brush (add 1px). That is bad approach. 2) Investigate why QPainter doesn't do filtering when there is no transparent pixels on the border of the source image. That is good approach. Git commit 48f8f2ce30a73d545a368b88444fb206e8281e98 by Dmitry Kazakov. Committed on 22/12/2013 at 14:53. Pushed by dkazakov into branch 'master'. Fix smooth rotation of the Predefined Brushes There is a bug in Qt which prevents a QImage from being transformed smoothly. See a comment in KisQImagePyramid::appendPyramidLevel. M +32 -6 krita/plugins/paintops/libbrush/kis_qimage_pyramid.cpp M +11 -1 krita/plugins/paintops/libbrush/kis_qimage_pyramid.h M +48 -0 krita/plugins/paintops/libbrush/tests/kis_brush_test.cpp M +2 -0 krita/plugins/paintops/libbrush/tests/kis_brush_test.h http://commits.kde.org/calligra/48f8f2ce30a73d545a368b88444fb206e8281e98 Git commit 896ba64f39f53adc9e56efbe0070cd40e206026e by Dmitry Kazakov. Committed on 22/12/2013 at 14:53. Pushed by dkazakov into branch 'calligra/2.8'. Fix smooth rotation of the Predefined Brushes There is a bug in Qt which prevents a QImage from being transformed smoothly. See a comment in KisQImagePyramid::appendPyramidLevel. M +32 -6 krita/plugins/paintops/libbrush/kis_qimage_pyramid.cpp M +11 -1 krita/plugins/paintops/libbrush/kis_qimage_pyramid.h M +48 -0 krita/plugins/paintops/libbrush/tests/kis_brush_test.cpp M +2 -0 krita/plugins/paintops/libbrush/tests/kis_brush_test.h http://commits.kde.org/calligra/896ba64f39f53adc9e56efbe0070cd40e206026e |