Skip to content

New colorsmudge engine for Krita 5.0

This branch is basically a rewritten version of the @voronwe's MR !422.

The patch implements:

  1. Lightness mode for the colorsmudge brush engine
    • the patch also implements a framework for storing interstroke data inside layers to let the paint dry out
  2. Color Image and Gradient modes for the colosmudge brush engine
  3. Separation of Smudge Rate and Color Rate option. See this wishlist and KA-thread.
  4. Fix for the non-smooth lines produced by Dulling mode when painting with pierced brushes. See this wishreport and this bug

Still to be done:

  1. F16 and F32 color spaces produce artifacts in Lightness mode
  2. Converting image colorspace U8->F32 should reset the interstroke data, not it creates weird artifacts after the conversion.
  3. KisOverlayPaintDeviceWrapper should not create the overlay for non-U8 devices in non-lightness mode
  4. KisPrecisePaintDeviceWrapper should be removed
  5. Smudge radius option is not yet ported into the strategy-based modes
  6. Smudge radius seems to do wrong sampling due to this commit.
  7. Smudge radius value is multiplied by 100 in the GUI. The fix should be backward-compatible. See this commit.
  8. Smudge radius should either have a GUI option or just be rewritten to fix "non-smooth lines produced by Dulling mode when painting with pierced brushes". The fix needs to weight the sampled colors by the current brush mask.
  9. Check if the current weighted Smudge Radius sampling algorithm can be optimized by doing some random sampling instead of the full coverage. Full coverage might be too slow for bigger brushes.
  10. Overlay mode is not yet available in strategy-based modes.
  11. Gradient and Color Image modes should be ported into strategies.
  12. New colorsmudge algorithm is extremely slow. It happens because all the blendind happens in U16 color space, and we have AVX/SSE optimizations only for U8 and F32
    • Reuse AlphaDarkenCompositor128 for U16 color spaces
    • Reuse OverCompositor128 for U16 color spaces
    • Implement SSE/AVX optimization for COMPOSITE_COPY blending mode. At least for U16 color spaces.
    • Implement SSE/AVX optimization for color space scaling in KisOverlayPaintDeviceWrapper
  13. Add dox to the new classes :)
  14. Check the status of Lightness and Gradient texture options and whether we can remove them.
  15. Overlay mode is not available for Lightness brush mode (and will never be). So it should be disabled.

Testing packages:

  1. DK1 (18.03.2021)

  2. DK2 (03.04.2021)

  3. DK3 (15.04.2021)

  4. DK4 (16.04.2021)

  5. DK7 (20.04.2021)

Edited by Dmitry Kazakov

Merge request reports