I have still trouble to feel at ease with KDE4 development, and fill the need to develop against a stable environment, so from time to time I do go back to Krita 1.6 and play with it and fill again my energy bar which I can then spend on Krita2. So last week I did wrote two filters (and I am still working on two others).
Faster Gaussian Blur
Bluring has always been one of the slowest operation in Krita (especially compared to what competitors do), mostly because of my laziness and, also, because for some reason the convolution code in Krita refused to work with non-square kernel (for absolutely no good reason). So, when I wrote the filter, I wrote it as a one pass filter, with one huge kernel, which means that for a bluring of 10 pixels radius, Krita was making 441 memory access and mathematical operations, while with a two pass blur filter, only 42 memory access and mathematical operations are needed, thus reducing the cost by a factor of ten, and the needed computation time as well.
But still we can do better, in fact, I have noticed that the second pass is twice as slow as the first one, which is probably due to fact that the convolution code is optimized for working with scanning line horizontally, while the second pass scan lines vertically.
The pictures made by most of camera isn’t always of the best quality, and they especially often lack of sharpness. It can happen for various reasons, ranging from bad lens, to bad sensors or to bad focus. So, one of the basic feature in picture editing is to increase the sharpness of an image. There are quiet a few techniques for doing this, until recently Krita only included what I call the “classical sharp” (it’s the simplest way of sharpening, it’s a convolution mask, very similar to bluring) and “unsharp mask” (the wikipedia entry describes it better than I will ever be able to). I have started playing with an article which proposed to use a pyramid representation of an image to increase its sharpness.
While the “classical sharp” is clearly the worse of all, it’s quiet unclear to determine which of the other two algorithms give the best results, and it also might depends of the parameters used for each one.