New brush in Krita: Softbrush

I’m quite busy right these days. I don’t have much time to blog about some nice stuff I have done in Krita in my “spare-thesis time”. I’m writing the thesis about brush engines I implemented for Krita and I wanted to have a brush that is very common among digital painters. I noticed that they heavily uses the basic Pixel brush. I decided I want to have some special pixel brush.

I stared to change the function that produce the brush mask and affects it’s softness. I selected Gaussian as it is nice function and I experiment with this function, but I found it complicated to control it (you setup sigma, uh what is sigma, you artist ask?). So let’s add some different function to the brush mask code. Oh, let’s put this decision to the artists hands, let’s give him some curve he can model as he want. We already has nice widget for that in Krita, so use it. So you can setup the brush mask by curve!

Setup brush softness with the curve

On the picture you can see Curve and Gaussian. The top red point represents the value of the brush mask in the center of the brush mask and the red point down in the right bottom corner represents the value of the edge of the brush mask. So far the brush mask supports only elliptical shape but I have also plans for rectangular shape of the brush mask but I need to find a way how to extend the 24-hours limit of the day so that I can code it You can add as many control points as you wish and tweak the softness between the center and edges.

You noticed the Gaussian also there, the mode and it’s code works but it will need some more love in the future. It gives some nice results also sometimes. I will see how it will end up.

So let’s make crazy setting of the curve and you can end up with the brush mask like this one with interesting edges:

Stroke with custom curve to change brush mask

As you can see, the brush supports pressure with no problems. Thanks to the Cyrille’s sensors you can change size by various attributes of your tablet or you can use some silk ones like a time or a distance. The brush supports also a rotation so you can setup some ellipse shape of the brush with a diameter and an aspect ratio and do some funny stuff like this one:

Dynamics of the soft brush in action

You setup an angle for your shape and you can allow Krita to manage the rotation for you. As you noticed, the opacity has been changing also, yes, you can control opacity with pressure. Those attributes are present in Pixel brush in Krita also. Let’s go for some new one.

I added parameter density to brush so that you can simulate in some non-photorealistic way brushes like charcoal, chalk and crayon. Basically you setup how many pixels from the brush mask will be used in a single dab. Very nice attribute, I managed to simulate a little charcoal drawing, here is my “developer” painting:

Softbrush density demo: Lukáš Tvrdý – House with charcoal

When you paint, your hand can shake. Maybe your hand is very stiff, and you don’t shake with your hand when you paint :D. So I added a parameter for you. It is called Jitter movement. You can setup how much the brush will be jittered when you paint. Maybe want to draw straight lines with shaky feeling. This is example of some mild jittering:

Softbrush mild jittering

If you exaggerate the parameter, you can end up with the result that spray brush, my other brush, do for you

Softbrush crazy jittering

Last feature, that is a little experimental, is called a HSV dynamics. I suppose you know what is HSV, it is physical color model, which model the color in terms of tint – hue, saturation and intensity – value. It was invented for artists so that they can more powerfully control the color they want to choose. I decided to change the parameters of the color dynamically in a stroke. This is still WIP (work-in-process) but so far you are able to grow the parameter, shrink and control it by pressure. Here is some demo, the feature with pressure can produce images with more gradients easily and you can avoid pick-that-color-and-put-it-here problem a little bit:

Softbrush: Hue growing, saturation shrinking and value growing

You can control the progression by a curve again and more control over the HSV can be done by using pressure option and using the tablet. These features are for 2.2. For 2.3 I already have some new feature and it is called mirroring and it was inspired by David Revoy video tutorial. He is using something very similar in video (link to 4:40).

You define the vertical axis with the softbrush with CTRL+LEFT click and then you paint in mirror mode. If you setup the axis outside the canvas, it is turned off.

As you paint, your brush mask is mirrored and then painted in the mirror mode. It is WIP also, we plan to make it more general so that every brush engine can use it. I get the idea as I was working on canvas mirroring.

I plan to blog about other new achievements but again time is issue. Beside I work on Krita full-time, I write thesis so I don’t have time these days. If you want to help me, you can produce some art with my brush engines and then I can include your work in my thesis! I’m interested in pictures created with spray, softbrush, sumi-e (will be renamed to hairy brush), deform brush and particle brush and its combination. Some of the pictures you see here are already part of my thesis. You need to compile trunk for it but it is easy!

So far enkithan and n-pigeon provided a lot of nice paintings for me. I pick up the picture that n-pigeon did lately with just soft brush and spray brush.

6 Responses to New brush in Krita: Softbrush

When painting I do quite a lot of painting on, then scraping, washing or even burning off of layers and I started thinking about brush(es) that would simulate this sort of thing.

I looked around and found that Photoshop has a “history brush” which is very nice but since it is designed for photo manipulation rather than painting, it is basically limited to “restore the area that I paint with this brush to a specific point in my history”.

So before I go off on a wild fancy imagining the useful ways a brush might be able to simulate the act of stripping away layers of paint, would the API allow it?

> Does the brush-engine API allow access to the history?
I’m not sure, but I can access the state of the layer before the stroke started, so just one level undo history.

>When painting I do quite a lot of painting on, then scraping, washing or even burning off of layers and I started thinking about >brush(es) that would simulate this sort of thing.
You are talking about digital painting or classical painting?

So my answer would be it is possible, but not with easy way. The API does not give you history access.
We have transaction system for undo/redo and there can lay the answer to your question.