Flowpaint 0.1 Released!

2 comments

Flowpaint version 0.1 has been released!

It's my first open source project that I have gotten as far as a public release :-)

I've been staying up until four (or even nine) the recent weeks and weekends working on it, but it's been mostly fun hacking. I automated as much as possible of the release process also, so it should be much less work for the next release. I'm doing cool stuff like autogenerating the changelog from the google code issue database (I'll post the python code in a later post), and injecting the release version and build number into property files baked into the application jar.

For the next release (which I hope to finish in a month, just in time for xmas) I'll have to refactor the rendering system and include undo history in it (that could be somewhat challenging). I'll also get to add input sliders for brush parameters (that should be fun). I wrote down my ideas for the painting rendering pipeline in some design notes in the Flowpaint wiki.

Starting the FlowPaint project

0 comments
One of my long term goals is to create a good paint program. I have several features that I'd like to see in a paint program, but that none of the current ones have.

I have some code for a half started one in the scratchpad directory of Skycastle, but now I went ahead and created a separate project for it. As usual, the hardest thing is to come up with a name - FlowPaint is refering to the state of flow that happens when you are immersed in painting - the application should support the workflow, instead of interrupting it.

You can find the development site of FlowPaint on Google Code.


Among other things, I want to render brush strokes as continuous textured areas, instead of repeatedly stamping a brush outline at short intervals along the stroke path like most existing paint programs do.

Here's the result of an evenings prototyping with Scala:


The stroke segment is defined by a start and endpoint, and the brush angle at the start and end. The renderer loops through the pixels to render, and calculates the position along the brush path, and the distance from the center of the path for each pixel, and then uses those values to query the brush implementation for a value. In this case the test brush returns a gradient to white towards the edges of the brush, and a gradient from red to yellow along the path of the brush. But it's also easy to write a brush implementation that instead uses a texture instead of a gradient to determine the color for each pixel. This opens up a lot of possibilities for the artist to produce complex patterns easily.

The prototype shows that the basic stroke segment rendering algorithm works, but performance is still a possible issue (the application will need to render a lot of segments fairly quickly, and re-render a part of the entire image when it is zoomed or panned significantly). A further spike to test out more optimized ways of rendering is likely needed (I scrapped my earlier plans for using 3D rendering, as render to texture isn't supported on the Intal graphics card on my tablet PC, and it would have caused a lot of trouble anyway).


Scala was very nice to work with. The prototype uses 9 small helper classes for things like Points, Lines, Brushes, etc. Often these are just one line in Scala. In Java each of these would have required an own file, and a lot of broilerplate accessories and constructor parameters, probably around 50 lines per file, including blank lines and comment lines. With Scala I can focus on thinking about the algorithm instead (the whole prototype is around 200 lines now, including blanklines and a few comments). I'll definitely continue using Scala for FlowPaint and future projects.