Allegro con spirito: A graphics editor for sprites

By

If you hear the word “sprite” and all you think of is soft drinks or fairies, you can skip this article. If, on the other hand, you know a sprite is a graphic image that’s part of a larger image or animation, you’ll probably be interested in the Allegro Sprite Editor (ASE), a program that helps you draw animated images from scratch.

ASE is not a photo retouching tool, it does not use vectors, and it does not have keyframes. Rather, it’s a graphics editor you can use to create pixel art, dot art, or video game sprites, drawing pixel by pixel, frame by frame, and layer by layer. The images you create with ASE are well-suited for use in low-res video games.

Creator David Capello says, “I wanted to develop video games and I needed a tool to create little sprites and animations using a specific color palette. When I started working on it about 10 years ago I was not happy with any of the existing tools, including the GIMP. I worked on the project for fun, as a personal challenge to improve my programming and design skills in my free time.” Capello is currently studying software engineering in Argentina and working as a C++ programmer.

Capello made the program open source from the start. “The GIMP was already out there, so it did not make sense to try to make money when such a big program was already available. Also, I wasn’t dedicated full-time to the program, so with open source I could get help from anyone.”

In a small project like ASE, help is always welcome. “A second developer would be great,” Capello says, “but not too many people want to constantly help in small open source projects like ASE. And it’s a shame, but there is almost zero documentation for developers, so that’s a big wall to jump for newcomers.

“People making tutorials and HOW TOs also would be a great help.” Capello posts such resources on his ASE Blog. “And I really appreciate feedback – that is one the most valuable things for open sources programs. When you get feature requests you find out what your application still needs and in what aspects you are failing as developer.”

ASE offers some special features you won’t find in a typical graphics editor:

— You can draw sprites using frames and layers as independent entities. “Other graphics editors ‘solve’ the concept of frames by using the same layers,” Capello says. “It makes it confusing for users when the same thing (a layer) is used to represent two different concepts (layers and frames). With ASE you can navigate layers and frames easily.”

— You can activate a Tiled mode in which what you draw outside the sprite is really drawn on the other side of the sprite. “Tiled mode is useful to draw patterns. It’s as if your sprite is in an infinite mosaic pattern and you can draw freely over it.”

— The pixel scaling option lets you see each pixel at double, triple, or quadruple its size. On the Windows platform, a pixel scaling of x2 is the default option. “The feeling when you draw sprites using pixel scaling is completely different. It is not just zooming the image, it like changing the whole interface-zoom to convert ASE to a DOS-like editor, such as Autodesk Animator Pro.”

— The Animator Editor, without which ASE is more or less like Microsoft Paint.

For a more extensive idea of what’s in the software, Capello recommends people look at the Quick Reference page.

Over the years Capello has used a number of software tools to create ASE. “Old prototypes were programmed using Turbo C and direct access to VGA memory. Then I found the Allegro game programming library, and that was a great improvement to develop under DOS with DJGPP. I switched to Linux in 2001, and the Allegro port was ready for that platform, so I started developing there with gcc, Emacs, and gdb. After some years I returned to Windows because of some hardware problems, and I started using MinGW. The most recent releases of ASE are compiled using Visual Studio 2008 Express, because its debugger is excellent for detecting runtime problems.

“I began writing ASE initially in C, but over the last few years I started to port it to C++. Right now the code is an ugly hybrid between the two, and from time to time I do big refactoring tasks to improve the internal design.”

Capello says he chose Allegro instead of a GUI library many years ago. “Around 2001 I was using Linux in console mode, without the X Window System, so as Allegro runs in console I start developing everything in console. I developed a special GUI library on top of Allegro (internally called Jinete) which had the basic widgets set for ASE. I feel much better drawing in low resolutions (like 320×240), so a lot of time I was using that resolution for ASE on Linux. I wrote the pixel scaling functionality when I switched back to Windows.”

The choice of Allegro did make it easier to spread the word about ASE, thanks to the allegro.cc portal, which showcases games and utilities made with Allegro. Capello says ASE’s popularity also increased when people started adding links to the ASE web site from forums and pixel art communities.

Capello tries to release a new version of ASE every three or four months. Among the new feature requests and improvements in the tracker now are:

— A tileset and tile maps editor, to edit tiles directly from a map
— A new, simpler copy/paste and transformation (scale/rotate) implementation
— An enhanced palette editor
— More configurable onion skinning
— Macro record and play