Bug 477561 - Pixel brush with size 2 or more does not create the pixels correctly
Summary: Pixel brush with size 2 or more does not create the pixels correctly
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 5.2.1
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-26 13:44 UTC by garuda1300
Modified: 2024-01-22 09:29 UTC (History)
2 users (show)

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


Attachments
Single Click with Pixel Art Brush with sharpness enabled (224.55 KB, image/png)
2023-11-26 22:32 UTC, garuda1300
Details

Note You need to log in before you can comment on or make changes to this bug.
Description garuda1300 2023-11-26 13:44:41 UTC
SUMMARY
Hello. Using Pixel Brush with size 2 or more the pixels most of the time will not be generated correctly of the chosen size, but will be generated missing a few pixels

STEPS TO REPRODUCE
1. Choose the pixel brush
2. Change the brush size to 2 or larger
3. Make a few clicks and scratches

OBSERVED RESULT
Most of the time it will be missing pixels

EXPECTED RESULT
That the pixels are created according to the chosen size and as shown in the Brush outline

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Linux Mint XFCE 21.3

ADDITIONAL INFORMATION
This issue also can be reproduced in Nightly Build krita-5.3.0-prealpha-2ddc7bb861-x86_64.appimage
Comment 1 Dmitry Kazakov 2023-11-26 17:38:57 UTC
Hi, garuda!

Could you please try using preset "Pixel1" with "sharpness" option enabled? If you still experience the problem, please make a screenshot of the problem so that we could understand the problem better.
Comment 2 garuda1300 2023-11-26 22:32:55 UTC
Created attachment 163512 [details]
Single Click with Pixel Art Brush with sharpness enabled

Hello, Dmitry Kazakov!

Thanks for the reply. I've attached an image as you said. And as you can see, it's missing a pixel in my single click. Sometimes it creates only 2 pixels.
Comment 3 Tiar 2024-01-22 09:29:44 UTC
Hi, if you check "Align the brush preview outline to the pixel grid", it should start to work fine.

However, that is, I think, a regression: in 5.1.5 the brush works as expected despite the checkbox not being checked, therefore making the "aligning to the pixel grid" a cosmetic checkbox instead of a functional one (and it was still important as a cosmetic checkbox since many people felt that constricting the brush outline to pixels felt worse, since it was "jumping" from one position to the next. There were many discussions about this).

Now the question is whether the change of behaviour was expected or not. I mean it changes the way an already saved brush works, so I would assume it's a regression and not an expected change.

Related commits: 4c639ee9bd5c958cce08598ecc3beea0182e7e33 (probable introduction of the wrong logic? Except it was already included in 5.1...)
And: 5fdf853a1a1fe21b04c6bf02584762040bd66628 (that is why it works differently in 5.2.0-beta1).

Faulty line: https://invent.kde.org/graphics/krita/-/blob/master/plugins/paintops/libpaintop/KisSharpnessOption.cpp#L34 - includes m_alignOutlinePixels, and that function is called in both outline painting and dab painting.
Fix: just separate two functions so that the outline is painted according to the checkbox, and the dab is always aligned, as it was before.

I will investigate further to understand how that happened, which should give a hint whether it was in any way intentional or just a mistake.