Let it be said up front: your editor is not an artist. He is, however,
given to the creation of simple diagrams for the explanation of data
structures, algorithms, etc.
![[Diagram example]](http://lwn.net/images/ns/grumpy/diagram-example.png)
See, for example, the diagram to the right, which comes from the
kobject introduction in the
Driver Porting Series. These images
can be a useful form of hand waving when complex subjects are being
discussed.
Back in the Golden Age of Proprietary Unix (around SunOS 3 or 4,
say), there weren't a whole lot of tools available for image editing. If
you youngsters out there want to get a feel for how desperate those times
could be, consider this: we often had to resort to tools like the LaTeX
picture mode to create drawings in digital form. Happily, things have
gotten better since then.
Things aren't enough better, however, that your editor has stopped keeping
an eye out for a better tool. This article is an attempt at summarizing
the current state of the art in free drawing editors. The emphasis here is
very much on the creation of diagrams and technical drawings; we'll not be
looking for the best tool for the creation of birthday party invitations,
pneumatic science fiction art, obnoxious animated banner ads, or beautiful
but incomprehensible icons. Your editor is trying to get some work done
and needs a diagram editor which doesn't drive him nuts.
idraw
For the first stop, we might as well complete the history lesson. Back in
the early days of X11, there were many efforts to produce The One Toolkit
which would unify the desktop. Actually, that situation hasn't changed a
whole lot in 15 years. One of the early efforts was a C++ framework called
InterViews. InterViews failed to change the world directly, though many of
its ideas and lessons have lived on in the design patterns community and in
projects like Fresco.
InterViews did, however, produce a drawing tool named idraw, which, for
years, was the definitive free drawing package. It combined full
functionality (for the time) with a well-thought-out interface and a nice
set of keyboard shortcuts. Creating drawings with idraw was a quick and
painless process. idraw stored its output as PostScript files, making the
drawings easy to print and the quality relatively good.
One might think that idraw's day has passed, given that
the InterViews team has not produced a release in over ten years. As it
turns out, however, there is a project (called ivtools) which is dedicated to
the maintenance and improvement of the InterViews toolkit and associated
tools. Releases are rare, but ivtools-1.0.4 came out last February.
That said, the simple fact is that idraw's time has passed. This program
has had little in the way of development for over a decade, it can't export
to interesting image file formats, it has no concept of layers, it depends
on a large toolkit that nobody uses, and it is a major unpleasant pain to
install. InterViews was an important step toward where we are today, but
even a grumpy editor sees the need to move beyond the 1980's and look at
what is being hacked on now.
XFig
Another tool with a long history is XFig. It shows many of the distinguishing
characteristics of an early X11 program (though it actually had its start
with SunView): home-brewed widgets, unique keyboard and mouse conventions,
etc. It is, however, a highly capable tool. XFig supports most of the
features one would expect from this sort of utility, though they can
sometimes be hard to find. It has a sort of layer support (it works by
assigning a numeric "depth" to every object), can export to any format one
could imagine, allows the creation of libraries of customized objects, etc.
XFig understands attachment points: when told to, it will stretch lines
which connect objects to each other to keep those connections when an
object is moved.
On the down side, XFig can only undo the most recent operation. Its
keyboard shortcuts are like those of no other application, and will take
some getting used to. The interface is highly modal; XFig's window
includes an area saying what the three mouse buttons will do at any given
time for a reason. Grouping objects, for example, requires selecting the
group "tool," selecting individual objects with the left button or
picking the corners of rectangles with middle button, then completing the
operation with the right button. Your editor's biggest problem with XFig,
however, is the quality of its image output. He might not be an artist,
but he would still rather see his work rendered with nice fonts and
antialiased lines. XFig's output prints nicely, but does not work as well
on the web; given that XFig is oriented toward tasks like the production of
complicated circuit diagrams, that is not entirely surprising.
Tgif
Tgif boasts a release
history going back to 1990; recent releases appear to be coming about once
per year. This tool resembles XFig in a number of ways; it, too, features
home-brew widgets and a unique interface. Tgif does have a more
conventional set of keyboard bindings, at least; Control-S will save the
current file, for example. Tgif's interface includes a sort of control panel where one
can spend a long time cycling through the various options (font sizes,
colors, fill patterns, etc.); fortunately, the menus provide a quicker way
of setting these attributes. Attachments are supported, making the
rearranging of diagrams easy.
Tgif does not support layers, which is a major disadvantage. Actually,
that is not quite true: it does have a "color layers" mode where each color
is rendered into a separate layer. This mode may be useful for certain
types of printed output, or for certain types of drawings (schematic
diagrams, perhaps) where objects in different colors really should be
separated. Tgif also allows drawings to have multiple pages; among other
things, these can be used to create animated GIF images. Your editor would
gladly trade both capabilities for a decent layering mechanism.
Tgif has a set of image editing functions that might have been better left
to the Gimp. What it does not have, alas, is antialiased image output.
Actually, exporting to images is strange in general; one must set the
"print format" to the desired image format, then "print" the diagram. The
image will be created without prompting for a name, and without regard to
any file which may have already existed with the chosen name.
Documentation for Tgif is sparse as well.
OpenOffice.org
OpenOffice.org comes with a drawing
tool which has been getting more capable over time.
As one might expect, it has almost every function imaginable, including 3D
effects, a library of tiled background images, attachments, etc.
OpenOffice may well be the only free drawing editor which performs
spell-checking. It supports layers, though the interface to layers is
clunky at best. Your editor must confess that OpenOffice tends to drive
him nuts. It can reset drawing attributes at unexpected times, it never
remembers what image format you exported to, and it is generally not the
fastest application on the processor. OpenOffice is a sort of Swiss Army
Knife; it can perform almost any function, but, for any given function, it
tends not to perform as well as a more focused tool.
OpenOffice will export to an unbelievable number of formats, including
(perhaps uniquely) PDF. When your editor exported to PNG, however, he got
the same old jagged lines. OpenOffice also exports a full page image,
while most other drawing editors will create an image which fits the
drawing.
All of the above notwithstanding, OpenOffice.org's editor is a worthwhile
addition to the Linux desktop.
Karbon14
Once upon a time, KDE had a program called Killustrator. The name ran into
trademark problems, which were circumvented by renaming the tool "Kontour."
But then the developers stopped working on Kontour, and that problem proved
harder to get around. So now, instead, the KDE project is pushing a tool
called Karbon14; it can be
found in KDE 3.2.
Karbon14 appears to be aimed at more artistic uses; it thus lacks some of
the features (snap to grid, attachments, arrow drawing) which are useful for diagram
creation. On the other hand, it has tools for drawing gradients and drop
shadows, as well as more dubious features like the "star" and "spiral"
tools. Karbon supports layers, but seems to want to put every object into
its own layer. It has a multi-level undo feature. There is also a plugin
mechanism for the addition of special effects.
Unfortunately, what Karbon14 also has is lots of bugs. Your editor, who
tried both the Fedora Core 2 Test 3 and Debian unstable
builds, found the tool easy to crash. The "zoom tool" can put it
into an infinite loop. Drawing polylines can produce hallucinogenic
results. Text drawing was never seen to work on either system. An attempt
to export to PNG yielded a solid black image - that is one way to get rid
of aliasing problems, but the results are not very helpful for web publication.
In all fairness, one should note that Karbon14 is currently at version
0.1. This tool has the potential to evolve into a capable, highly-featured
drawing editor. But it's not yet ready for a grumpy editor's desktop.
Dia
GNOME's entry in the diagram editor category is dia.
This tool, currently at version 0.93 (released without fanfare on
May 1), has been no stranger to obnoxious
bugs in the past, but it has stabilized nicely over the last year or so.
It is, at the moment, your editor's diagram editor of choice.
Dia is clearly oriented toward the creation of diagrams. It has
snap-to-grid, layers, attachments, and several libraries of objects for
schematics, flowcharts, UML diagrams, etc. On the other hand, it lacks
gradient editors, 3D swirl generators, shadows, and fancy background
clip-art. Dia does beautiful antialiasing, both on-screen and in image
exports. On the other hand, control of object attributes is inconsistent
and sometimes hard to find. Rectangle filling is controlled by
double-clicking on the rectangle tool icon; control of arrowhead dimensions
is, instead, obtained by selecting "details" at the end of a long list of
possible arrow types. Alignment and grouping operations require navigating
through a series of cascading menus; some keyboard shortcuts would be nice
here.
Dia also has a reasonably comprehensive set of configuration options, which
is always a nice surprise in a GNOME application. For example, it is
possible to turn off the "switch back to the select tool after every
operation" mode that seems to be so popular in modern interfaces, but which
your editor finds obnoxious. Dia features a Gimp-style right-button menu
which provides access to everything, but that menu can be replaced with a
toolbar by tweaking the appropriate preference.
In conclusion...
A few other packages are worth a quick mention:
- Xdraft looks like an
attempt to make a serious free drafting application. Unfortunately,
it also looks like it has gone idle over the last year.
- Sodipodi
is a well-advanced vector drawing package. It is aimed more at
artists than creators of cheap diagrams, however, so it has not been
reviewed in detail here.
- If you wander deeply enough into the
Gimp's menus, you'll find GFig,
which appears to be an attempt to graft some vector drawing operations
into that utility. GFig may work for adding certain effects to
images, but it still doesn't turn the Gimp into a drawing editor; the
Gimp has many strengths, but this is not one of them.
As this survey shows, the free software community offers a wealth of
diagram editing tools. Many of them have reached a reasonable level of
maturity though, like people, they are aging in different ways. These
applications are seeing substantial development and are evolving quickly.
Before long, the community should have some of the best tools available
anywhere. Grumpy creators of hand-waving diagrams everywhere should
rejoice.
(
Log in to post comments)