Brainstorming/BrushEngine

From MyPaint

Jump to: navigation, search

This page is dedicated to ideas regarding making the brush library.

This is a brainstorming page, a place for new ideas and suggestions.
To contribute, please follow the these guidelines and help us keeping the wiki organized.

Contents

[edit] Refactoring

[edit] Acyclic graph for input/output mapping

Author(s): Lukacu

Current state: At the moment MyPaint brush engine has a lot of parameters to set, some of which are easy to understand and some are not. A lot of flexibility is a good thing, of course, but the problem is that it appears that they are just added when somebody needs them (like speed1, speed2 issue). It is also hard to write some serious documentation this way.

Proposed change: It is a quite big change actually. The idea is that the input values (pressure, tilt, etc.) would be mapped to output parameters (size, opacity, color, etc.) using an acyclic graph of transformations. This approach is used in many graphics applications (e.g. for image filters). It is also very general and extensible, so no more out-of-the-context hacking would be needed.

Pros:

  • General
  • Easy to understand what a brush does (IIRC Python has some nice graph drawing libraries that could represent the brush behavior in a nice way)
  • Powerful (it is hard to imagine what kind of crazy transformations could be done this way)


Cons:

  • A lot of work (more C++ code)
  • A more powerful brush file format needed (XML) - this also means that existing brushes would have to be rewritten. I know this sounds like a deal-breaker but otherwise we are just postponing the inevitable.


[edit] Features

[edit] New input value: direction change

Author(s): Artis Rozentāls

Current state: The elliptical dab parameters provide a good way to create brushes following the stroke direction. However when combined with a low value direction filter for a close, natural tracking sharp curves develop little stars of elliptical dabs at their ends. Slightly increasing the direction filter gives somewhat more visually pleasing effects, but doesn't give a proper line and the default value completely destroys the directional effect.

File:fuzzballs.png

Proposed change: Create a direction change input value that is zero in straight stroke segments and increases when the direction changes, up to 1 for 180 degree turns. It would enable to reduce the elliptical dab ratio and radius on sharp curves, smoothing their tips without sacrificing the directional effect.

I imagine it working somewhat like this: File:direction_change_illustration.png

A direction change multiplier would be necessary to work with elliptical dab ratios that are bigger then 2.0.

Pros:

  • Enables the creation of intuitive and smooth stroking brushes.

Cons:

  • Additional complexity when creating brushes.
  • Possible speed loss due to computing an additional input value.