Graphics Tools for Linux
Ever since I wrote my first basic program to peek and poke my way through a series of animated block graphics on a TRS-80 Model 1, I have been intrigued by the use of computers for graphics. I learned every new language by modifying a graphics program I had written in some other language. In high school and my early days of college these programs were simple games—later I learned of the Mandelbrot and Julia fractal algorithms. These algorithms were relatively simple to program and so became my tool for learning new languages, environments and, more importantly, graphics systems.
Over the years this fascination would wax and wane. Not surprisingly, my interest would peak when some new movie with the latest, greatest special effects was released. Star Wars came out when I got my hands on the TRS-80, so naturally I had X-Wing fighters evading a simulated crosshair radar written in BASIC, albeit by the time the radar locked, the pilot of the X Wing had probably died from old age.
Late in 1995, a co-worker and I began to work on our company's web pages. I had done my own pages, but they lacked good graphics. He was convinced he could do the graphics while I did the HTML. His enthusiasm became annoying when he began to laud the merits of MS-Windows-based graphic tools like Adobe Photoshop, and went on about how Linux, and Unix in general, lacked any such tools. Since I knew most of the special effects I was seeing in movies were coming from Silicon Graphics or other Unix systems, I knew comparable tools must be available for Linux.
And then came Toy Story. I was fascinated. I was enthralled. I was completely hooked. I set out to find Linux tools that I could use to update my web pages and to show the world what could be done on a Linux box.
This article introduces the tools I found, tells how the information I gathered grew into the Linux Graphics mini-HOWTO (see Resources box), and explores how the graphics arena is evolving on Linux. I assume the reader is a graphics beginner, and I focus on tools currently available. I touch only briefly on the programming environments and libraries available to do graphics, since these require a more in-depth discussion; however, I also don't want to rehash the Linux Graphics mini-HOWTO. After reading this article, you can check out the mini-HOWTO to get more details.
When you get right down to it, there are really only four types of tools available for graphics on Linux:
Viewing - tools which display images but don't change them
Creation - tools which create images
Manipulation - tools which change existing images
Conversion - tools which convert images to new formats
Various tools are available for each of these types. Many tools fit into more than one category. The dividing line between categories is not always clear, but the use of categories helped in organizing the Graphics mini-HOWTO.
Creation tools also provide one of two basic functions: they draw or they render images. Drawing tools provide the ability to interactively create shapes, called primitives, such as boxes, circles, cones or torii. Creation tools also include paint programs. Rendering tools build images based on model information, i.e., information that describes the shapes of primitives and their relationships in a scene. The simplest way to distinguish between the two is that drawing programs generally deal with 2D images, and rendering tools deal with 3D images. This is an oversimplification but it will suffice for this article.
Images are pictures, basically, which come in a number of formats. GIF, JPEG, PNG and TGA are some of the more common static image formats, but there are literally hundreds of others. No one format is the standard, so there isn't one format that every tool supports. GIF and JPEG are the most widely supported formats for web browsers, but you can expect to see PNG support in many browsers and other tools soon. Which format you use depends on the tools you use and the way you intend to use the images. For example, GIF isn't good for large posters, because it lacks support for more than 256 colors per image. TGA, on the other hand, provides a large range of colors but isn't supported by web browsers.
Static images, like photographs, are single, independent pictures. Animated images can be strings of static images or images created on the fly by programs written using special languages or programming libraries. A lot of interest in computer graphics has been generated by the use of animated images; however, it is important for new users to understand static images before moving into animation. For that reason, animation tools are not discussed in this article.
A number of programming libraries are available for use in supporting the various graphics formats and certain types of primitives, functions and algorithms. Libraries already exist for TIFF, JPEG, PNG, and many other image formats, so programmers don't have to reinvent the wheel with each new program they write. Also available are a number of languages and programming interfaces for creating 2D and 3D graphics and runtime animation, including VRML, OpenGL and PHIGS.
Figure 1. AC3D Screen with Imported DXF Model for a Sailplane
Figure 2. GIMP Windows
Special Reports: DevOps
Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help!
With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, advice & help from the experts, plus a host of other books, videos, podcasts and more. All free with a quick, one-time registration. Start browsing now...
- The Ubuntu Conspiracy
- A First Look at IBM's New Linux Servers
- Vigilante Malware
- Disney's Linux Light Bulbs (Not a "Luxo Jr." Reboot)
- Vagrant Simplified
- Libreboot on an X60, Part I: the Setup
- System Status as SMS Text Messages
- Dealing with Boundary Issues
- Bluetooth Hacks
- Non-Linux FOSS: Code Your Way To Victory!