Bug 359858

Summary: Round pixel brush jagged when size is between 9 and 4.
Product: [Applications] krita Reporter: Andrej <andrej.elbers>
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: dimula73, ethedona, gremriel, griffinvalley, halla, melcx, reptillia39, tamtamy.tymona
Priority: NOR    
Version: 3.0 Alpha   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
URL: https://dl.dropboxusercontent.com/u/5368378/Screenshots/pix.png
Latest Commit: Version Fixed In:
Attachments: Screenshot of the brushes in question (look normal)
Artifacts with Pixel art brush

Description Andrej 2016-02-27 13:23:58 UTC
I created a round pixel brush:

Pixel brush engine
Fade: 1
Sharpness: 1

The dots should be symmetrical but come out jagged when using brushsizes 9, 8, 7, 6, 5, 4.

Reproducible: Always
Comment 1 Andrej 2016-02-27 13:27:49 UTC
https://dl.dropboxusercontent.com/u/5368378/Screenshots/pix2.PNG

^attached picture sized up
Comment 2 wolthera 2016-03-01 13:16:34 UTC
I can confirm this, it seems to be related to coordinates.

When we draw a circle with the circle tool and a 1 px brush, it's result looks awkward.
When we draw a circle on a vector layer and then trace the shape with a 1pixel brush, the outline is similarly awkward.

When we take that vector circle, and make sure that both the x and y coordinates are *.5 (so, for example, 20.5 and 16.5), and then trace the shape with a 1px brush, the result is correct. It seems that disabling subpixel precision does not account for centering the coordinate, but rather tries to stick it onto the top-left, which results in strange approximations.

We could hack around this by making this explicit in the sharpness method.

It is also known that we have some hardcoded super-duper-extra-special precision going on in sizes below 9px, (something I recall from the anti-aliasing method) which probably also affects all this.
Comment 3 Dmitry Kazakov 2018-04-03 11:56:33 UTC
Created attachment 111798 [details]
Screenshot of the brushes in question (look normal)

Hi, Andrej!

Could you upload a screenshot again? I cannot reproduce the problem and your demo screenshot is not available anymore.
Comment 4 Andrej 2018-04-03 14:11:01 UTC
(In reply to Dmitry Kazakov from comment #3)
> Created attachment 111798 [details]
> Screenshot of the brushes in question (look normal)
> 
> Hi, Andrej!
> 
> Could you upload a screenshot again? I cannot reproduce the problem and your
> demo screenshot is not available anymore.

Hi Dimitry, 

I found the screenshot in my Dropbox: https://www.dropbox.com/s/l0yv9zxj3gkkvh1/pix2.PNG?dl=0

I have not tried to reproduce it with the current version of Krita yet.

Best regards
Comment 5 reptillia39 2018-04-25 20:14:53 UTC
The problem still exists in current Krita, but I think a solution exists already. Enabling snapping in coordinate by every pixels with .5 should fix almost every problems associated with pixel art, and situation where small good looking circle (without it being pixel art). It doesn't even have to be explicit in sharpness. If there was a way to snap on the .5 coordinates, that would work.
Comment 6 reptillia39 2018-04-25 22:46:13 UTC
Since I can't edit, snapping to 1,.5 or 5.,1 seem to fix line problems at a pixel level, or even 2.5,2.5 in cases of circles.
Comment 7 Gremriel 2018-10-25 08:53:26 UTC
Not entirely sure this related, but drawing rectangles with the rectangle tool and a small pixel brush (either Pixel Art or Deevad 5b Pixel produces weird lines with artifacts. This happens with brush sizes of 5px and below.
Brushes of 6px and higher work fine.

Also, the circle, polygon and line tools work as expected at all brush sizes.
Comment 8 Tiar 2019-05-22 11:32:28 UTC
*** Bug 407824 has been marked as a duplicate of this bug. ***
Comment 9 Tiar 2019-05-22 12:00:35 UTC
Can you reproduce this behavior in Krita 4.2.0 beta? (I can in 4.1.7, and cannot in beta).
Comment 10 Gremriel 2019-05-22 12:22:52 UTC
Created attachment 120248 [details]
Artifacts with Pixel art brush
Comment 11 Gremriel 2019-05-22 12:23:51 UTC
(In reply to Gremriel from comment #10)
> Created attachment 120248 [details]
> Artifacts with Pixel art brush

This is with krita-nightly-x64-v4.2.0-alpha-126-gd3175ce38f

(If this is a separate issue, please let me know, I'll file a bug report.
Comment 12 Halla Rempt 2019-05-23 12:00:09 UTC
Setting to confirmed.
Comment 13 wolthera 2019-10-02 15:18:58 UTC
Having discussed this with Ivan, what is probably necessary is either...

1. A seperate brushengine.
2. (Or simpler) a seperate autobrush mask for pixelperfect masks, where we can ensure the circles are the appropriate shape, if necessary hardcoded.