Bug 413085 - Basic-5 Size preset is producing jittering, jagged stroke outlines
Summary: Basic-5 Size preset is producing jittering, jagged stroke outlines
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: unspecified
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-10-17 12:57 UTC by Tyson Tan
Modified: 2019-11-05 17:18 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Basic-5 Size preset 4.2.7.1 vs 4.3.0prealpha (231.95 KB, image/png)
2019-10-17 12:57 UTC, Tyson Tan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2019-10-17 12:57:25 UTC
Created attachment 123273 [details]
Basic-5 Size preset 4.2.7.1 vs 4.3.0prealpha

In recent 4.3.0 nightly builds, I noticed that "Basic-5 Size" preset is producing jittering, jagged stroke outlines, as if the pressure signal was fluctuating or the anti-aliasing was broken. Image comparison in attachment.

Tested with:
krita-4.3.0-prealpha-14f55dc-x86_64 (affected)
krita-4.2.7.1b-x86_64.appimage (unaffected)
Comment 1 wolthera 2019-10-17 13:31:14 UTC
This is because the precision isn't set to 5, which in turn is caused by the precision delta being fixed inbetween these versions.
Comment 2 Tyson Tan 2019-10-17 14:24:05 UTC
(In reply to wolthera from comment #1)
> This is because the precision isn't set to 5, which in turn is caused by the
> precision delta being fixed inbetween these versions.

But the precision is actually 5...unless I missed something?

F5 brush panel: (by default)
[+] Auto | Starting Brush size: 10.00px | Delta: 15.00px | Precision: 5

Diameter: about 250px
Comment 3 Halla Rempt 2019-10-21 08:50:13 UTC
This is a regression from this commit:

commit ca2e423a9af4f5c1f4691ab3e5f86d5fee61938b
Author: Dmitry Kazakov <dimula73@gmail.com>
Date:   Mon Oct 14 17:45:21 2019 +0300
Fix an assert when force-autosaving the image right during the stroke
When we make a clone of a shape layer, we must ensure that no updates
are initiated after cloning the image. We used to block updates at
the level of KisShapeLayerCanvas, but it works only when we save/clone
the image from the GUI thread. When we save it from the worker thread,
KoShapeManager queues the event into the GUI events queue, so an update
comes asynchronously.
To resolve this issue, the patch moves locking from KisShapeLayerCanvas
to KoShapeManager. We must ensure that there is no compressors nor queues
between the adding code and blocking code.
BUG:412835
Comment 4 Tyson Tan 2019-10-22 16:56:25 UTC
Thank you everyone! :)
Comment 5 Dmitry Kazakov 2019-10-25 16:09:16 UTC
Yes, the bug happens because of the auto-precision option. It looks like the way how it is calculated has changed.
Comment 6 Halla Rempt 2019-10-29 08:53:15 UTC
*** Bug 413582 has been marked as a duplicate of this bug. ***
Comment 7 kaplan 2019-10-29 09:03:20 UTC
I just want to confirm that I got the same issue but in 4.2.7.1

(Bug 413582, that was a duplicate. Sorry about that)
Comment 8 Halla Rempt 2019-10-29 09:04:45 UTC
The patch that broke this, f54aaece8453b7620bb49c23fd98df, was backported to 4.2.7.1 already. It actually fixed autoprecision to work, which we now discover is undesirable.
Comment 9 Halla Rempt 2019-10-29 09:06:10 UTC
Or not, I cannot find it...
Comment 10 Dmitry Kazakov 2019-10-30 19:30:52 UTC
Git commit 0d6bd4e9c2d5879e3a0406d612fabdf6e20af801 by Dmitry Kazakov.
Committed on 30/10/2019 at 19:30.
Pushed by dkazakov into branch 'master'.

Rewrite "Auto Precision" option

The patch basically removes old implementation of auto-brush and
substitutes it with simple heuristics:

1) If brush size is below 30px, use full precision (level 5)
2) If brush has a texture, scatter, mirror, rotation or airbrush
   option, then disable subpixel precision (level 3)

The heuristics are chosen this way to make sure that all the older presets
work fine. The problem is that auto-precision option did nothing for
several previous versions of Krita (it just returned precision 5 all
the time), therefore brush creators bascially couldn't configure it
properly. The new implementation makes sure that most of the presets
with auto-precision will still have precision level 5, like it used to
be before auto-precision "fix".

The patch does *not* add any UI strings (only removes a few). So it
is safe to be backported to 4.2.

M  +6    -0    plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
M  +1    -53   plugins/paintops/libpaintop/forms/wdgbrushchooser.ui
M  +4    -0    plugins/paintops/libpaintop/kis_brush_based_paintop.cpp
M  +6    -70   plugins/paintops/libpaintop/kis_brush_selection_widget.cpp
M  +0    -4    plugins/paintops/libpaintop/kis_brush_selection_widget.h
M  +3    -5    plugins/paintops/libpaintop/kis_dab_cache_base.cpp
M  +19   -47   plugins/paintops/libpaintop/kis_precision_option.cpp
M  +5    -5    plugins/paintops/libpaintop/kis_precision_option.h
M  +0    -1    plugins/paintops/libpaintop/kis_text_brush_chooser.cpp
M  +0    -1    plugins/paintops/libpaintop/kis_text_brush_chooser.h

https://invent.kde.org/kde/krita/commit/0d6bd4e9c2d5879e3a0406d612fabdf6e20af801
Comment 11 Tyson Tan 2019-10-31 01:30:05 UTC
Thank you Dmitry! :D
Comment 12 Dmitry Kazakov 2019-11-05 17:18:19 UTC
Git commit a4085f0873310d12a03242e455b3e0432d451ed7 by Dmitry Kazakov.
Committed on 05/11/2019 at 17:18.
Pushed by dkazakov into branch 'krita/4.2'.

Rewrite "Auto Precision" option

The patch basically removes old implementation of auto-brush and
substitutes it with simple heuristics:

1) If brush size is below 30px, use full precision (level 5)
2) If brush has a texture, scatter, mirror, rotation or airbrush
   option, then disable subpixel precision (level 3)

The heuristics are chosen this way to make sure that all the older presets
work fine. The problem is that auto-precision option did nothing for
several previous versions of Krita (it just returned precision 5 all
the time), therefore brush creators bascially couldn't configure it
properly. The new implementation makes sure that most of the presets
with auto-precision will still have precision level 5, like it used to
be before auto-precision "fix".

The patch does *not* add any UI strings (only removes a few). So it
is safe to be backported to 4.2.

# Conflicts:
#	plugins/paintops/libpaintop/kis_brush_selection_widget.cpp
#	plugins/paintops/libpaintop/kis_brush_selection_widget.h
#	plugins/paintops/libpaintop/kis_dab_cache_base.cpp

M  +6    -0    plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
M  +1    -53   plugins/paintops/libpaintop/forms/wdgbrushchooser.ui
M  +4    -0    plugins/paintops/libpaintop/kis_brush_based_paintop.cpp
M  +8    -44   plugins/paintops/libpaintop/kis_brush_selection_widget.cpp
M  +0    -2    plugins/paintops/libpaintop/kis_brush_selection_widget.h
M  +6    -1    plugins/paintops/libpaintop/kis_dab_cache_base.cpp
M  +19   -47   plugins/paintops/libpaintop/kis_precision_option.cpp
M  +5    -5    plugins/paintops/libpaintop/kis_precision_option.h

https://invent.kde.org/kde/krita/commit/a4085f0873310d12a03242e455b3e0432d451ed7