gimp brush ideas and whatnot

A couple folks who read this over at layers.gimp.org and pixels.gimp.org and/or #gimp mentioned that I should let people know the various
works in progress I have going on, regardless of there current state.

So aside from the stuff at adrian.gimp.org/patches, I have a couple other
projects.

1. Adding support for rotating brush maps into the brushcore.

    This isn’t too hard actually. Just add some support for rotating temp-bufs (the structure that the brush masks are stored in, basically just a traditional “char *” pixmap plus some meta info.). Then plug it into gimpbrushcore at the approriate places. For the most part, this means finding the places we scale, and adding support for rotation as well. Then a couple ui things to add it to the dialogs. One interesting thing is the transformed brush cache can potentially get pretty big, since you can scale and rotate a brush, making for lots of things to cache.

    Now if your a graphics person, your probably saying “you have scale already, and your talking about adding rotation support, which not just add arbitrary affine transforms?”. Yup, why not?

    So, what the heck do rotated brushes buy you anyway? Well, since you can rotate based on the angle of the brush strokes, you can “align” the brush with the stroke. Some of the image hoses already do this to interesting effect.

    I have partial code for this somewhere.

2. Support for sampling the “background” image and computing the average color to use

    A very simple trick to make something look “impressionistic” is to average a groups of pixel’d colors, and replace all the pixels in the group with that color. With the right shaped “group”, it looks pretty cool. So, the idea is to choose the color to paint a brush stroke color with by averaging the colors under the brush stroke, and painting with that color. Add in scaling brushes, or brushes that follow the stroke direction, and you can get very interesting effects.

    An interesting question of course, is how to “average” colors. Just average the RGB colors is one approach. But converting the colors to HSV or HSL or CIE colorspaces might produce better results (I suspect CIE in particular, since thats a non linear transformation into a colorspace designed to similuate how the human eye actually works). But once the basic bits are there, thats all easy enough to changes. It would also be easy to add in computing average hue/sat/val, or “hottest” color, or most popular or dominate color (kind of an on the fly artistic color quantization). But mainly, I think it would look cool.

    Only issue from what I recall was figuring out which pixels are actually under the brush mask, and not just the brush bounding box. Also, how to weight in the alpha channel. Probably just premultiplying the mask into the background, and skipping fully transparent pixels is good enough.

    I have partial code for this somewhere.

3. A tool options/presets selector

    A given tool in Gimp has a lot of options, plus a “context” which includes the brush, colors, paint mode, etc. Starting in 2.2 or so, theres the option of saving “presets” of tool options. So you can recall say “chunky black brush with low opacity” and “single pixel brush with colors from gradient ‘foobar'”. However, the UI for doing this kind of sucks. Namely, you have to change to the tool, and then select the preset.

    I want a dialog with a list of tool options for all tools that I can oranize as I see fit. So that it is one click to switch from the crop tool with weird settings, to the brush you use for removing zits, to the smudge you use to curl hair. I think it would make the tool options presets much easier to use.

    I had some code for this, but it vanished in a reinstall at some point. I doubt much of the patch would apply to current gimp anyway.


An example of what you can do in my tree atm, which does not include any of the above ideas yet.