Skip to content

Add new brush texture blending modes

Description

This MR implements the texturing modes explained in T14345. In the task it is explained how the strength parameter could be applied in three different ways, I chose the second one in which the strength weights the dab contribution.

Some notes

  • Since these modes use the strength I didn't try to integrate them with for example the masking brush ones. But in almost all the cases the strength is just multiplied with the dab so there is room for integration.
  • I use a custom color dodge because the one in krita (cfColorDodge) seems to produce more speckles, maybe due to the 0/0 case. Maybe it would be better to modify that function and then it could be used here. See ColorBurnBlendStrategy::apply for an example of simplification.
  • For the hard mix mode I use a method that approximates the one used by Photoshop in the texturing of brushes. It is a variant that doesn't produce super hard, aliased, edges, as explained in the task. Maybe it could be used in the masked brush also. I find this method more pleasant for brushes.
  • I didn't include the linear dodge mode since the results are not great. In the case of the masked brush it can work because the mask can be smaller than the tip, but in the case of texturing the mask extends indefinitelly. For an example of the ugly effect choose a brush with no texture and select masked brush with a very large tip.
  • The linear burn mode looks fine but the result would be as the subtract mode with the texture inverted, so I didn't include it.

User tests

Some tests by wojtryb:

Some tests by hulmanen:

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Deif Lou

Merge request reports