June 16, 2010
This article was contributed by Nathan Willis
Artist Tom Lechner presented
his application Laidout at Libre Graphics
Meeting 2010 in Brussels, garnering widespread praise from the attendees
for its technical abilities. Video of the presentation is online,
but for a closer look you can download the code yourself and try it out.
The application offers an eclectic mix of tools — many with no other
open source competition — for manipulating images and documents destined for printing.
It's more like an imposition?
The initial goal of Laidout was to serve as an open source tool for impositioning; that is, laying out a document that was designed on a per-page basis (as all word processors and essentially all desktop publishers do) with full control over how the individual pages are arranged and aligned on the physical paper.
With an application like Scribus, if you wish to print (for example) a booklet on letter-sized paper folded in half, you must manually figure out which pages go back-to-back and arrange them in Scribus so that the final result, when printed, folds into the correct order front-to-back. An impositioning tool performs that step for you, and recalculates if you add or remove pages. More complicated procedures, such as printing on large stock, folding, and cutting, are also part of the process.
Professional print shops often handle impositioning themselves, which for large runs enables them to minimize paper usage and other costs. But Lechner illustrates and prints his own cartoon books, so he wanted full control over the process.
GPLv2-licensed source code and Debian packages are available through Laidout.org. The latest release is 0.9, from February of 2010. There are no peculiar dependencies; lower-level image-processing libraries such as imlib2 and libpng, modern FreeType and CUPS packages, and other standard libraries are all that are required. Laidout's GUI is coded directly in a widget toolkit of Lechner's own design called Laxkit, which is graphically reminiscent of Xlib but should run without issue on any desktop Linux distribution.
Laidout features a few object manipulation tools, but does not sport a full vector editing environment like Inkscape or text tools like Scribus. Instead, it focuses on importing a variety of document types, allowing the user to rearrange and manipulate them, and export the results. PDF 1.4, EPS, SVG, and several other common formats (including native Scribus documents) are supported as both input and output.
Some of the file formats offer only partial support, but Laidout does
its best to preserve data that it does not understand (labeling it "mystery
data").
Scribus receives the most attention; the newest release even supports
impositioning documents that use Scribus's advanced "render frames"
feature. Render frames
allow Scribus documents to embed calls to TeX, MathML, or other external
content renderers. Lechner also provides a Python script that uses Laidout to
imposition a Scribus document that is, by default, set for impositioning a
letter-sized document for printing on tabloid-sized paper stock.
In the basic workflow to make a booklet, the user would first create a new document in Laidout, specifying the paper size, orientation, and choosing the "booklet" impositioning style. The user could then import a multi-page document created in Scribus (or another supported application), and rearrange the resulting paper layout in Laidout's Spread Editor. For linear book content, of course, there is probably only one correct order, but for artistic creations, the ability to move the pages around at will is a nice feature. Laidout can print the resulting compound document directly via lp, or save to any of the supported output file formats.
Laidout employs a separate mode for the loosely related task of tiling large images, allowing the user to divide up a image for printing on multiple sheets of paper which can be individually and arbitrarily arranged.
Another feature takes page layout into an entirely new dimension, "Net Impositions," which automatically remap images onto non-rectangular paper — specifically, unwrapped 3-D polyhedra. Lechner added this feature in order to easily print 360-degree panoramic photos onto paper in a format that could be cut out and folded into a three-dimensional shape for viewing. He has several examples of the technique on his Flickr photo stream. The polyhedron used as the surface is defined in a separate file (described on the web site), and can be "unwrapped" into a 2-D paper in any manner.
Image editing
In addition to its layout capabilities, Lechner is continually adding new image editing tools to Laidout. The latest release adds vector-based path editing, which he admits is noticeably less full-featured than that of a primary vector editor. Text tools and other staples are on the roadmap.
There are several gems to be found in the current palette of tools, however, including some features not found in other open source applications. The gradient editor is remarkably intuitive, allowing in-place linear and radial gradient editing and arbitrary rearrangement of gradient stops, while retaining an easy-to-understand interface. Similarly, all images can be scaled, rotated, and sheared at will, around arbitrary points, and the actual pages on which the layout takes place can be rotated as well.
An interesting addition to the toolbox is the "ColorPatch" editor, which can create and edit two-dimensional gradient fields. As with other gradients, all of the control points can be edited in-place, but what really makes the tool interesting is the ability to subdivide the gradient object, adding as many rows or columns of control points as desired. Inkscape has added the same basic functionality (called "gradient meshes"), but Laidout's controls are easier to work with.
If gradient meshes don't seem interesting on their own, however, the "ImagePatch" might. It uses the same underlying components as the ColorPatch editor, but allows the user to distort and manipulate imported raster images. Again, the basic controls for distorting the corners, edges, and midpoint are made considerably more powerful by the ability to subdivide the image with additional sets of control points. Lechner observes on the site how useful this feature would be in a full raster editor like GIMP, which is undeniable.
Caveats
As much fun as Laidout is, it is not nearly as stable as the big
graphics projects, and requires a lot of learning. The latter, primarily, is because Lechner develops it for his own personal use, and adapts it as his needs change. He describes it as "rough and experimental" but adds "I'm endeavoring to change that, but there are only so many hours in the day!" He said that Laidout has only been downloaded around 3000 times so far, and that although he has gotten little feedback, he hopes to build the application into something useful for others in the cartoon and zine world.
Another factor that contributes to Laidout's learning curve is that the interface uses Laxkit instead of a familiar GUI toolkit like GKT+ or Qt. It differs in appearance, but also incorporates different behavior in the windows and tools, such as right-clicking in the "gutter" between window panes to bring up a context menu. This is not to say that the differences are bad, per se, but they are different. Rather than a standard color selector widget, for example, you can change the selected foreground color by clicking and dragging the mouse inside the color box: a left-click alters the red channel, a middle-click the green, and a right-click the blue. It sounds strange at first, but once you get the hang of it, it's easy to do.
Lechner said he initially decided to build his own toolkit for the challenge of it, because he could not keep up with the changing dependencies of the existing toolkits, and because the existing toolkits did not offer the flexibility in controls that he wanted. Coding Laxkit took more time than he originally estimated, but it does allow him to change the APIs at will without hurting hundreds of other developers. He is currently working on adding XInput2's multi-device and multi-touch gesture support.
Growing from a single-developer project into a tool with a wider user
(and developer) base is a challenge for any application. The response to
Lechner's Laidout talk at LGM indicates that there is great interest in
what the program does. A few other open source applications have attempted
impositioning support in the past (such as the PDF editor PoDoFo and the possibly
unmaintained EasyPose),
but it is still missing from the major desktop publishing utilities, which
several of the artists and publishers at LGM commented on. The other
features, including mapping spherical panoramas onto arbitrary polyhedra — well — they're just cool.
With any luck, the exposure at LGM will attract new developers to Laidout, either to work on project management tasks like bug reporting and documentation, or important pieces of the feature roadmap like text support, but without losing that singular, mad-scientist-like feel that makes it so much fun to play around with.
(
Log in to post comments)