Archive for January, 2013

More Krita 2.7 features

January 4, 2013

Recently Boudwijn presented his vacation work on the flipbook and smoothing feature. He wasn’t the only one having fun hacking new Krita features. I’m presenting you some of the new features that I developed in the last few days.

Freehand path tool

First feature I worked on was the “Freehand path tool” (Not the best name, I might rename that if I find a better one). Krita users might already know the old Pencil tool that came from Karbon and could also be used in Krita for vector graphics. One of the shortcoming of that tool was that it so far couldn’t use Krita brushes, which confused some users.

To solve that I created a the new tool which internally reuses the pencil tool and uses the painting capability of the path tool. With the result that the new tool can be used on pixel and vector layer. When painting on pixel-based layers Krita will paint with the current brush, on a vector layer it will insert a shape.

One might wonder why this is a big deal compared to the already existing freehand tool. The interesting feature of this tool is that the complete stroke stays a path until it’s finished. This allows some nice post-processing steps e.g. it possible to smooth the stroke much more than the freehand tool can while painting. Small downside with the is that it doesn’t use brush dynamics.

The screenshots below show an example with my mouse path and the resulting smooth stroke painted with a Krita brush (I cranked up the smoothing, so it a far more aggressive smoothing than one would usually use).



Painting any shape with Krita brushes

Almost immediately after I had done the Freehand path tool, I got the next request. If we can stroke any path path shape with Krita, why not add the functionality to do it with all shapes? I thought that would be pretty easy to do, turned out it needed some tricky coordinate transformation. But I finally got it working an the result is quite fun.

In the screenshot below you can see a flower shape that I let it paint with the pixel brush:


Also interesting is that you can open SVG files in Krita and then trace all the paths inside it.

QML Export

The last feature that I added was the ability to export to QML. This feature is especially interesting for everybody designing special QML interfaces. It exports a all the top-level layers in the Krita image as image and creates a QML file where all the images are inserted as image objects, so the QML UI looks exactly like in Krita (if you you the default composite op). Other attributes that are exported are layer name and opacity, which are mapped to the id and opacity of the object.

A very simple example:


Currently it only exports QML 1.1, but that should be easy to change when I use Qt 5.

More coming in 2013…

2013 will be a very interesting year for Krita with 2.6 to be released this month, 2.7 in summer with the features above and then 2.8 in fall/winter. I also think that Krita Sketch will gain more attraction. We have a lots of things coming up in terms of fixes and performance improvements.

Personally the one thing I’m looking most forward to in 2013 is KDE Frameworks 5. I think it will really be a game changer for Krita, allowing us to cut a number of dependencies which will make Krita much more interesting for many non-KDE users. A Krita version based on it will most likely take till 2014.

Don’t forget the Create Konqui with Krita contest. You still have till end of the month to submit your entry.