Thursday, January 31, 2008

Jade - Introduction

It is hard to find a decent sketching program for Linux. Particularly one that is free (preferably open source) and has the features I need. The best candidates I have found are the GIMP, Krita, Gogh and Mypaint. It is possible to run free version (1.something) of openCanvas via Wine. Also Pixia can be run using Wine.

GIMP has plenty of functionality. It is oriented towards image manipulation, not sketching though. Krita is a rising star and it's more oriented towards sketching than GIMP. It is missing some functionality I find necessary.

Gogh and Mypaint are sketching programs. Gogh provides a primitive layer system. Its brushes cannot compete with Mypaint though. Mypaint is missing layers altogether. Besides really nice brush system it provides an alternative solution to canvas. Its canvas is practically unlimited.

openCanvas provides possibility to save the drawing in an event file. This is a major feature not seen in many programs. I haven't used Pixia a lot but it seems quite basic to me. It has some nice little innovations in its user interface.

Basically I need a program that combines the relevant features of the mentioned programs. And then some (Photoshop, Painter etc.). This is the main motivation for the development of Jade.

My main requirements for a sketching program are:
  1. Playback á la openCanvas.
  2. Layer system of some sort.
  3. Versatile brush system.
  4. Transformable canvas.
In my first prototype known as "bepaint" I implemented a simple system to provide playback. I used PyGTK and Glade for development. I used a widget known as DrawingArea as a canvas. The brush system of the prototype was extremely limited. It provided merely color and brush size. It allowed the user to transform (rotate/scale/translate) the drawing. Also functionality to save/load work was provided.

In Jade I aim to provide a better brush system (something equivalent to GIMP at least), transformable canvas, playback and layer system. I decided to use Cairo as the drawing backend. Cairo offers many benefits over native PyGTK implementation. It basically means that I don't have to reinvent the wheel as it provides plenty of functionality I need. Its compositing features are quite rudimentary but that is something that can be worked around.

I have already implemented a basic brush system that supports size, falloff, opacity and spacing. I also provide a simple brush preview. The brushes are read from xml files. This makes sharing them easy. The brush system is far from perfect though. It is still missing possibility to use shapes and texture. Also several options (paint, erase, blur, smudge, smear) are still needed.

The brush system is based on stamping. In other words during a brush stroke images of currently active brush are drawn on the canvas. This operation is quite resource intensive. Therefore it could be interesting to implement a path based brush. Paths are much faster to calculate and they don't have certain problems that stamp based system has.

Basic implementation of canvas is about ready. I decided to implement canvas differently than in bepaint. In bepaint whole drawing area was the whole canvas. In Jade there can be multiple canvases on a single drawing area. Each canvas contains a Cairo surface. The nice benefit of this is that I basically get transformations for free this way as Cairo provides a transformation matrix that can be easily modified.

The implementation of multicanvas system is still in progress. I have several ideas that may lead to a layer system that is integrated within the drawing area. This is yet something I have to try out.

I have designed and implemented the data structures needed by the playback system. I still have to hook up the user interface to it. Also I have yet to write file read/write.

I am sure there's a lot more to do than I mentioned in this entry. I will keep the blog updated as I make progress. There is still certain key functionality missing preventing a proper test release. Hopefully I will be able to release soon though.

Oh. And in case you are interested, here are some development screenshots of Jade: