Tuesday, August 12, 2008

Jade renamed to Cassopi - new development blog open

Jade has been renamed to Cassopi. You can find the reasons and more information at http://cassopidev.blogspot.com/.

Sunday, February 3, 2008

Current Progress + PyGTK Threads

My current goal is to make the drawing system more responsive. I originally tried to use Cairo surfaces and draw on them and redraw screen every once in a while (10 times per second or so). The problem with my implementation was that it was simply too slow. Drawing a dab (individual part of a stroke) on surface in the background and then drawing the surface takes more time than I can afford to.

So I had to devise a new plan. I implemented a simple path based drawing model. It is still extremely rudimentary but it works to some extent. The biggest factor making it considerably faster than the old implementation is that I draw directly on drawing area (ie. I use it as Cairo context). Next I have to make it fit the architecture and add facilities that make sure the drawn stroke gets stored.

Before I figured out the current solution, I looked into threading options offered by PyGTK and Python. I found a couple of pages that summarize different options well. They work as a good reference material. So here you go:

I also found a nice page about using OpenGL with Cairo.

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: