Bug 412756 - Artifacts on 8 bit brushes that get composited at low transparencies.
Summary: Artifacts on 8 bit brushes that get composited at low transparencies.
Status: ASSIGNED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-09 11:17 UTC by wolthera
Modified: 2019-10-24 18:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
On the left there's a stroke with the airbrush preset on an 16bit layer, on the right it's on the 8bit layer. Observe the weird pattern on the right at full brightness. (467.93 KB, image/png)
2019-10-09 11:17 UTC, wolthera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wolthera 2019-10-09 11:17:28 UTC
Created attachment 123099 [details]
On the left there's a stroke with the airbrush preset on an 16bit layer, on the right it's on the 8bit layer. Observe the weird pattern on the right at full brightness.

SUMMARY
8bit brush compositing has artifacts compared to 16bit brush compositing. This is most clear when using a soft low slow brush, as the artifacts compound.

STEPS TO REPRODUCE
1. Make an 8bit canvas and a 16bit canvas
2. Take brush with a soft or gaussian mask at low flow and low spacing.
3. Draw a few strokes on both.

OBSERVED RESULT
At full brightness, there's clear artifacts on the 8bit image and not on the 16bit image.

EXPECTED RESULT
Minimal difference between the 8 and 16bit images. Preferably full smoothness.

ADDITIONAL INFORMATION
Ok, so we actually discussed this one thoroughly in the IRC:

There's three places we can do something:

1. The compositing in the brush engine. This is how a similar problem was solved with the color smudge brush. However, this will only work for wash mode, and not for the build-up mode.
2.  it can be fixed at the level of sse-compositions and mask processors. They already have floating point representations, so we can just make rounding more fuzzy. This is the most likely candidate, and right now there's discussion in the IRC on the fastest dithering method(or rather, the fastest randomness method) we can think of)
3. 16bit(or higher) brush masks. This is something no other program seems to have and will require a lot of time, so this is more a feature. This will make the 16bit example smoother too.
Comment 1 Tiar 2019-10-09 11:31:50 UTC
Boud wrote: 

> Wikipedia says https://en.wikipedia.org/wiki/Xoroshiro128%2B is right now the fastest one on 64 bit cpu's.

Dmitry wrote:

> I have a feeling that our taus88 is a subset of this algorithm... https://www.boost.org/doc/libs/1_66_0/doc/html/boost/random/taus88.html

Also Dmitry said that the random generator should be able to generate at least 870 millions of numbers per second. If Wikipedia is right aboud 1.2 nanoseconds per number, that would give us ~833 millions numbers pers second, which is close. There was also a suggestion to use an array of random numbers instead.
Comment 2 wolthera 2019-10-09 11:34:26 UTC
There was also a mention that the dissolve blending mode right now uses 'qrand()' instead of an array, so that one can be sped up with this as well.
Comment 3 Halla Rempt 2019-10-24 18:38:27 UTC
Putting to wish/project since we want to make it an Intel project.