Gimp’s pipe brushes

The Gimp nowadays comes with a small set of rather nifty brushes — the so-called pipe brushes, recognizable from the file-extension .gih. The fileformat for these brushes is actually really horrible, a mix between text and binary. The first line contains the brush name, the second the number of brushes the brush contains, a space, and a bit of text detailing the way the brush ought to be used.

Today (and yesterday) I spent time creating a class that could load those brushes, and actually use them. Well, that’s done. I still don’t parse the bit of text — a ‘parasite’ in Gimp parlance — so you just get all the images in the brush in order, and I don’t make a difference between brushes that are really gray-scale masks to be used with the currently selected colour, and the brushes that are really collections of images that can be pasted into the drawing directly.

But on the other hand, I support pressure-sensitivity for every pipe brush:

Pity that pre-computing all those masks takes such a lot of memory. Krita now wants about 256 MB of memory at startup…