Besides my sponsored work on Krita, I work in my spare time (if I find some) on some new features. I did a thesis about brush painting and I still enjoy this topic. So when I find some new interesting brush, that might be usable, I’m trying to adopt it in Krita as a new brush engine. Few months ago I discovered project Harmony and I liked the brushes there. Especially Sketchy, Shaded, Chrome, Fur and Long Fur. The idea for those brushes comes from concept of connecting neighbour points. The concept was realized first in Scribbler and Harmony was inspired. Then I adopted the Harmony version in Krita.
Painted by software developer, with Sketch in Krita
The adoption has some advantages like undo/redo and some different and new features and one drawback.
New features compared to Harmony
You can create new brushes, because I adopted all five brushes from Harmony as one big brush engine with parameters. I explored the code and came up with names for the parameters, which influence the stroke of the brush. So you can change the size of brush easily. In original Harmony project, the area is just circle with fixed size, that detects the points. In Krita it can be any brush tip (ellipse, flower, chain). I don’t how much is this usable, but at least I found ellipse quite useful compared to circle. Anyway you can create more effects compared to the Harmony version.
For performance reasons you will find in Brush size dialog checkbox called Simple mode, which means that again circle area will be used if check. For the size of the circle, the size of the brush tip you choose in Brush tip is used. What is the performance problem here? Maybe you need some big circle and rasterization of that circle as brush mask is quite slow. On the other hand checking the points in this simple mode in the circle is quite fast no matter of the size.
The main options for the brush are in Brush size option dialog. Let me describe them a little. Line width is new feature compared to Harmony. You can setup the width of the line that is used as connection between the points of the stroke.
Sketch can stroke with different width of the connection lines
Offset scale is partially reverse engineered from Harmony. It influence the size of the connection line between two points. Actually it changes the offset of the start and end point of the connection line. Here I need to work on better UI, because now it is confusing. When you setup the offset to 0% or 100%, it looks same. Weird, right? You can see the demonstration on of it on the next picture.
Offset scale: 60%, 90%, 100%, 200%
Density influence the number of lines. When the brush detects point in the neighbour, it starts to think: Should I make a connection? Hm..let’s look at the density.Ah, density is 100%, why I’m thinking about, of course make a connection. When the density is e.g. 20% the brush think like this: Hm…density is 20%, that means 1 line from 5 detections of neighbour points should be rasterized. Let’s roll the dice. Oh, I can’t make connection – neeeext! There is also related checkbox option called Use distance density. This one uses the distance of the points and dice to decide if to make the connection. It changes the size of the brush due to the way it computes the density of the lines. If you setup 50% density, check the distance density and use the brush tip of size 64, it will usually make connection only for points that are in the distance of 32 pixels and will also roll a dice if it should make a connection. This option is from original Harmony project. I wanted to control the density just by dice, but I wanted to make presets that mimics the Harmony and I needed this one.
Density 100%, 20%, 1%
Magnetify option decides whether to connect the current point with points from stroke or to make line with offset right and left and the current mouse position. If the brush is not magnetifying, the effect creates nice fur effect. Tweak the offset scale to get nice effects.
Fur effect in Sketch
Random opacity checked causes that in every line has random opacity. This effect was present in Harmony.
Random RGB checked causes that the color of the single line is distorted per channel by random generator. This was needed to support Chrome from Harmony
Distance density checked causes that the connection line will have density according the distance between points that are going to be connected.
Paint connection line checked paints connection line between two positions of the brush always (previous mouse position and current mouse position).
Then I added support for tablet to the Sketch. I implemented it through standard Krita dialogs like Size sensor, Opacity sensor and Rotation sensor. So you can use also different sensors to change the size like fade or for rotation drawing angle. Size sensor changes the size of the area where the detection occurs. Opacity sensor changes the opacity of the dab. In one dab there can be many lines rendered as many points are checked — it is not per line opacity, that’s why there is Random opacity. Rotation sensor rotate the brush tip shape, which is used for detecting the neighbour points. I usually use the ellipse and setup the Rotation sensor to drawing angle. Thanks to the lately added dynamic outlines you can see where it is detecting the points.
You can see the size of the brush on canvas. In Harmony you see just the cursor. I have to improve the situation – somehow the center of the brush is also important. You can switch to showing the cursor instead of the brush outline to temporary workaround it but I plan to add some cross in the middle of the shape.
You can’t undo the stroke in Harmony, you can in Krita 😉
Missing feature compared to Harmony
The detection between the neighbour points occurs only per stroke in Krita’s adoption. In Harmony you can connect to points from previous strokes. I put this problem on the feature list for 2.4 as that is not support in our API yet – to be able to store information about previous strokes somewhere. Brush engine life span takes from the start of the stroke to the end of the stroke. You don’t have information about previous stroke available in the brush engine. Slovak (me) and Russian (Dmitry Medvedev Kazakov) Krita developers will take care of this feature together as it needs to work correctly with undo/redo. Question is if we also want to connect to points only on the same layer or per layer or make it optional. We will find out something.
This brush engine is in experimental state and will be released in Krita 2.3. Experimental brush engine means that the presets you make might not work in Krita 2.4 as the UI will be changed (improved of course) and the brush engine is still under development. I hope to add the missing feature for 2.4 and polish the UI.
There are presets that mimics the Harmony brushes: Sketchy, Shaded, Chrome and Fur (I lost the Long Fur preset, but I will try to fix it). They are installed with Krita, so you can explore them and tweak them as you wish. Preset is the setting of the brush engine saved on the disk if you did not know. The Ribbon brush from Harmony is already in Krita, behaves little differently and it is called Particle brush in Krita. Other brush engines are for me less usable and quite specific so, I do not plan to port them (yet).
If you create (please, do..) something nice, please, sent it to our gallery at Krita forum.