Sunday, September 28, 2008

DrawPile 0.5.0

A new DrawPile release is out, little less than two weeks after I resumed the project. This was mainly a bug fix release, introducing a new more stable and robust server and fixing many bugs and usability problems in the client.
The 0.5.0 release has one new major feature: an annotation tool. The annotation tool is pretty much like the text tool in other drawing programs, except the text always floats above the actual image. Because DrawPile doesn't have its own image format (yet), the annotations cannot be saved. They can, however, be burned onto the image (in offline mode only, more on that below.)

With this maintenance release out of the way, next up is more features!


Drawing long lines, especially thin ones, causes nasty jaggies as DrawPile doesn't support subpixel brushes at the moment. This is going to change in the next release. The latest SVN trunk already contains some preliminary subpixel drawing code. Here is how it compares to the old DrawPile and GIMP:


A pen tool that always draws with 100% hardness and no antialiasing will be added, so pixel editing will still be possible. Another new feature that will probably make it to the next release is composition modes. (Add, multiply, darken, lighten and such)


At the moment, DrawPile's tile engine isn't really being used for anything you couldn't do with a huge contiguous image. Splitting the image into tiles makes it possible (or rather, easier) to do some cool things. For example, tiles make it fairly easy to efficiently implement layers. Having layer support means we can also do things like indirect drawing.
Indirect drawing means drawing into a temporary layer first, then compositing the whole stroke onto the image at the same time. This mode seems to be the default on most other drawing programs. Indirect drawing makes it possible to paint with uniform opacity and, in DrawPile's case, removes the need for preview strokes.

There's also one other thing tiles make fairly easy to do: Undo. Unfortunately, it's not that obvious how undo should work in a multiuser environment, so that's one feature DrawPile isn't getting quite yet.

Finally, as mentioned above, the annotation tool currently cannot burn the text onto the image while connected to a network session. The problem is that there is no way to guarantee that each participant of the session has the same font and the same font rendering engine. For example, on Linux Qt uses freetype, while on Windows it uses GDI.
There is a way around this problem though. When a user decides to bake an annotation, instead of just telling others to do the same, DrawPile sends the rasterized text to the other users and they composite that instead of whatever they have. There are still some practical problems that must be worked out with this approach, but this is most likely the way to go. Incidentally, adding support for sending arbitrary raster data as drawing commands also enables features such as pasting from a clipboard.

Sunday, September 14, 2008

Continuing work on DrawPile

After a year's hiatus, I decided to start working on DrawPile again.
First thing I did, was rewrite the old server. The new server is QT based (no more other external dependencies) and built as a shared library that can be embedded inside the client and in a tiny standalone shell.
The protocol also underwent a revamp. The new protocol is much more simpler, but also lacks some of the features the old one had (multiple sessions on one server.) The reason I decided to drop these features was that they weren't being used in the client and were and unnecessary complication.
One nice feature the new server has, is the ability to buffer raster data and drawing commands. The server can then efficiently handle new clients with minimal disturbance to other users, and is more robust to boot.

The latest SVN trunk has the new server and a couple of fixes that should make DrawPile much more stable. The drawing code is still slightly broken though. Next up, a new drawing engine, then the 0.5.0 release!