Week 32,33,34: Sheep, fixing and cleaning Krita

Let’s review what I was working on in Krita lately. On Monday, week 32 I pinged  David Revoy on #krita IRC channel, digital painter,with question what bugs him in Krita the most lately. He wrote nice report for us, but he started with 3 things.

First, he was missing global curve for the pressure mapping. Every dynamic parameter can be controlled by pressure from tablet and with custom curve for it. But the global curve is also useful and we did not have that one. I implemented it, you can tweak it in Settings->Configure Krita->Tablet settings, which shows just one big curve widget for you. On the related note, Adam Celarek is working on new curve widget as the current one is optimal for image processing but not much e.g. for painting.

Next David’s request was option for setting the color of the canvas border. He is using GNOME and some dark theme. Our gray color was too much for him. First enkithan suggested some GTK theme for Qt to him. But the canvas border is not theme-able. I’m not sure if it should be, probably not.So I added new option in Settings->Configure Krita->Display -> Canvas Border.

When you do speed painting as David, you need to be fast :). One of the tasks that is slow is to pick color. And to make it fast, we made the painting tool to be able to pick colors.You just press CTRL and you pick color. Precision was missing, you were not able to see what color you are picking when the tools are in brush outline mode. I fixed it by showing the Color picker tool icon. Next problem was our strategy to pick color. Before the color was picked when you pressed the mouse button. If you moved, the color was not changed. I did not like that behavior, so I changed it. Now when you pick color, you click and you can move and you see in color selectors the color you are selecting. When I was on it, I checked also our color picker tool and fixed the behavior there too. Color picker is little more stronger then the freehand tool,e.g. it can do averaging of the area you are picking.

Holiday week 33 followed, I had holiday week,I was taking care of some sheep in Greece and enjoying the sea.

No code, just sheep

Next week was devoted to cleaning. We have same brush engines that overlap with features. So I started to merge them. I started with Soft brush. It is brush engine I wrote for my thesis. It’s main feature is that you can setup softness/hardness by curve, so it is more powerful then just one linear value. Also soft brush has density feature which is usable e.g. for chalk simulation and you can control softness with pressure. I merged it with Pixel Brush.

I ported the code as circle mask generator based on curve and wrote a new rectangular one. The rectangular mask generator was not present in the old one, so it is new feature 😉 I also added support for the spikes. Then I fixed the way we compute the preview — this is also nice, now you can have live preview of the brush mask inherited from Pixel Brush gui. It was not there before! It’s cool as you can see how the change of the curve reacts to the resulting mask without the need of some stroke testing.

Then I ported the density feature. Now you can have density also with old (default) Pixel Brush masks.I plan to add the density feature also to brush masks.

Soft brush had also “jitter movement” feature. As you paint, the position of the dab is jittered as you would have shaking hands. I implemented it as sensor and I renamed it to “Scattering” and added possibility to jitter in two axes (X, Y), which are rotated according the drawing angle. It will be useful when we will map the Photoshop brushes to Krita – Photoshop has similar feature with less options. It is merged, so now you can spray in Pixel brush. But only one dab per scatter event. Spray brush has a new competitor.

Other feature was the softness controlled by pressure. Now it is dynamic also for Pixel Brush. Both fading/curve softness can be controlled by sensor. It was little tricky for soft brush, I wanted to improve it so I changed the way I compute it now: You setup the curve and the softness is changed by moving the points of the curve on it’s y-coordinate according the pressure. All points are transformed expect the first and the last one. If there are only two points, one artificial point is added to the center of the curve and translated up&down according the pressure (or sensor value).

The merge has many benefits for the users. Now you can spray the soft brush masks with spray! Or you can use soft brush mask for hairy brush bristles! Cool!

Then I co-operated with Sven Langkamp regarding the fix of the deserialization of the gimp brush presets. The brush was not selected in the UI when you loaded the preset, but it painted. It had bugs like wrong outline etc. Reported by David Revoy, fixed by Krita team!

Other brush engine, called Pixel Pencil, was not written by me. But the code was so similar to Pixel brush, that I decided to merge it. I created one new sensor called Sharpness and it is responsible to give Pixel Pencil behavior. All it does is converting the sub-pixel positions into pixel positions – the masks are more sharp. Then it does thresholding of the alpha values of the mask. If the brush mask pixel is lower then threshold, it is replaced by transparent pixel, otherwise it is replaced by opaque pixel. No anti-aliasing — Pencil effect. Merged!

My first brush engine, the derivation of the Hairy Brush (actually Hairy Brush is derivation of the Chalk but that is different story) called Chalk is merged too as it does everything as Soft brush, which is now merged in Pixel Brush. Only the Fade effect was missing. I implemented it as a new sensor. It will be also useful when the Photoshop brushes will be mapped to Krita more. It was missing for that work too. Extra points also for work on abr brushes 😉 I will prepare the factory preset so that the chalk is easily found.

I spotted some bugs with deserialization of the brush masks. E.g. deserialization of the rectangular mask type did not worked – nobody tested the preset with that type of the mask probably. It might be less used. I did mistake too when implementing the merge and I fixed the deserialization of the mask types (so far default mask type and soft brush mask type – Gimp brush mask type might come handy in the feature).

Next week I will continue to work on Krita. I suppose to prepare Action Plan v3 thanks to the donation from Silvio, big Krita supporter. Basically I will fix bugs from bugzilla and from reports from the Krita artists (enkithan, Animtim, deevad, …). The aim of the last part of my sponsored work is stability effort. It will take one month and maybe some more. Cheers!

This entry was posted in Krita. Bookmark the permalink.

7 Responses to Week 32,33,34: Sheep, fixing and cleaning Krita

  1. Silvio Grosso says:

    Well done, indeed 😉

  2. And no grenouille ?

  3. Excellent work. I’m glad Krita is seeing so much progress and that David is continuing to throw feature requests at you.

    Also (and I know it’s stupid English’s fault) but the plural of ‘sheep’ is ‘sheep’. I’ve no idea why but maybe it just sounds better that way. To avoid this degeneracy I like to joke and tell people that if the plural is ‘sheep’ then the singular must be ‘shoop’ :)

  4. DanaKil says:

    Hi :)

    “But the canvas border is not theme-able. I’m not sure if it should be, probably not.”

    I wondered some times ago why the background of documents in apps like KOffice or even the background in Gwenview and so on is not themable… Do you really think it’s by purpose ? Or maybe this kind of background was not really used when the theme specs were made ? It could be quite useful IMHO and let applications decide if they need to override the default setting.

  5. LukasT says:

    @Silvio: thanks :)
    @Cyrille: no, just sheep and sometimes jelly-fish
    @Matt: Thanks for English lesson, fixed!
    @DanaKil: interesting idea, I will throw that on Krita devs! I’m not very involved in other KOffice apps development. I’m involved in Krita.

  6. n-pigeon says:

    Wow, a lot of work you made! Good job!

  7. Inge Wallin says:

    Haha! I can clearly see you are thinking about code in that picture.

Leave a Reply