Thursday 26 July 2007

It's alive!

I just a while ago committed feMerge support in Inkscape SVN. Now, we have all the parts required to render the example image in SVG specification!

Several other example files are now rendered correctly, too. This filter primitive doesn't bring anything really new, because everything it does, can be done with feComposite, feBlend or even with the simple alpha compositing used in SVG outside filters. It's just an easy way for filter creators to composite several images into one.

Also, check out the Filter effects page in Inkscape wiki. There's a nice listing, which filters work and which don't. There really is a good amount of filters that already work.

Tuesday 24 July 2007

Lighting examples

Well, I got around and made an example image with lighting. This utilizes gaussian blur, diffuse and specular lighting and feCompose modes arithmetic and in.

New Inkscape developers

I haven't gotten much code done for Inkscape lately. Small bugfixes here and there, but nothing big really. Most of my time has gone into developing a 4k intro for Assembly 2007 and helping out new Inkscape developers.

Yes, indeed. There are two new guys, who have jumped into developing filters for Inkscape. Thanks to them, we have three new filter primitives implemented in Inkscape: feConvolveMatrix, feDiffuseLighting and feSpecularLighting. Once again, these open up new possibilities for artists using Inkscape.

Now I propably should toss in some examples using these new filters. I don't have any, so I'll toss in the Filter effects example from SVG specification. It shows one possible use for these lighting effects. Actually, Inkscape is almost able to render that one correctly, only feMerge filter primitive is missing.

For feConvolveMatrix then, it can be used for effects like blur, edge detection, embossing, sharpening.

That 4k intro even has a connection to Inkscape: the engine is able to render bezier shapes and I've used Inkscape for designing those shapes. More of that later, so I don't spoil it for anyone ;)

Monday 9 July 2007

Introducing feComposite

I decided to postpone turbulence filter for a while and go ahead with my original plans. So now, Inkscape has a new filter primitive, feComposite.

Composite in this case refers to Porter-Duff compositing operators, introduced in a paper "Compositing Digital Images" by T. Porter and T. Duff. These compositing operators can provide quite interesting results, though I'm yet to come up with a example where they could be used. Well, one thing useful could be cutting holes to objects, for which using boolean operations would not be feasible.

Reading that paper, so I could implement the filter, a strange feeling of perspective crossed my mind. Even though computer graphics is a rather new area of study, this paper has been written before I was even born. Only a year before, but still.

Creating this filter I came upon several parts of filtering code, that should be simpler to use. Especially handling temporary images requires too much boilerplate code. So next, I will look into improving handling temporary images.

Thursday 5 July 2007

Timidity power usage

A while ago, I tried profiling my computer power usage with PowerTOP. This showed, that Timidity was waking up 100 times per second. As I wasn't using midi for anything at the time, this seemed rather odd. Tracing running Timidity with strace, I noticed that the alsa sequencer interface was polling something.

Digging Timidity cvs tree, I noticed this polling was introduced, when stream tracing support was added to alsa interface. Stream tracing allows for displaying Timidity state in real time, so it can't just sleep until something happens. For normal usage as software midi interface, this is useless. Before this tracing support was added, Timidity did sleep until some event occurred.

So, this patch makes Timidity alsa sequencer interface poll at 100 Hz only, when stream tracing is used. Otherwise, it just sleeps until something happens. This doesn't seem to break anything and considering that it doesn't actually add new functionality, I believe it's safe to use.

The patch: nopoll.diff

Tuesday 3 July 2007

I can has turbulence?

feTurbulence is a rather problematic filter to create. It would be certainly be useful for same reasons gaussian blur is useful: it's hard to achieve the same result with only vector shapes.

Well, the first problem is, that the description of this effect in the SVG standard is rather vague. It mostly consists of C-source, which implements this effect. Well, this code doesn't even compile with gcc. It has only a couple useful comments and they describe the simple RNG used for this effect. What I have, is code that presumably calculates the colour value for single pixel, if I manage to figure out, what exactly I should pass it as parameters.

The second problem is a long-time PIA. The filters rendering code receives a bounding box, which is almost but not quite what SVG standard defines as bounding box. Well, for non-rotated and non-skewed object coordinate systems at least. With this effect, one fills the whole filter effects area, which is usually specified relative to the bounding box. (default is to expand the bounding box by 10% to every direction) As feTurbulence fills this whole area, it's really important to have correct size for this area. Otherwise, this will result in inconsistency between different SVG viewers, potentially also between different Inkscape releases.

Monday 2 July 2007

In the Mood

This weekend, I was at the PuistoBlues blues festival in Järvenpää, Finland. Not only as a visitor, either. A couple days before the main concert I was building the tents - one for the VIP persons, a couple for serving beer, the backstage etc. On the day after the main concert, I was then tearing those same tents down.

I'm not too big a fan of blues, though I've become more interested in it in the last couple of months, as I've been learning to play harmonica. For me, this has more to it than only blues. It's a big festival in my former hometown and the artists there are world-class. The best thing still is the atmosphere on days before and after the main concert, as most people there creating the festival are volunteers. They (or actually, we) are not building the festival for money but because of the ambitions towards blues or the festival.

Well, the bands there were good. Once again, I didn't like the biggest stars Johnny Winter and Keb Mo so much as those playing before them. Or maybe at that point I was already too tired to pay attention. Well, anyhow. A Finnish band J. Karjalainen Lännen-Jukka was really good, though some people nearby me were pondering, if it was blues at all. It wasn't anything anything too polished, but more like simple country style music. J. Karjalainen himself was playing banjo along with a violinist, guitarist and a mandolin player.

Jody Williams & Billy Boy Arnold played more regular blues. Before their show, what caught my attention was, that Billy Boy Arnold is a harmonica player. This was a big point for me, I wanted to hear and see how he played. And were they ever good! I liked especially their pianist, in red shirt and hammering away on a grand piano.

There was also a local group, the Super Blues Band, who had also played at the first PuistoBlues thirty years ago. Quite a feat, I have to say.