Vol.32 No.1 February 1999
Per H. Christensen
A contour image represents the essence of a scene, a “simplified reality.” Contours are used in non-photorealistic images for comics and cartoons to illustrate geometric shape, spatial relationships, color, texture and illumination. This article describes traditional and computer-generated contour rendering, gives examples of contour placement and styles, discusses some practical issues, and describes the contour shader interface of the rendering program mental ray.
Traditional Contour Images
The first use of contour lines to illustrate objects can be found in prehistoric cave paintings. The ancient Egyptians used contour drawings to decorate tombs: first a master painter drew the outline of the objects to be depicted, then a bas-relief sculptor carved into the rock along the contour lines, and finally a painter would fill in color between the carved contour lines. The Bayeux tapestry is another example of early use of contours, it illustrates William the Conqueror's conquest of England in 1066.
Contour lines are an important part of the styles of comics and cartoons. Max and Moritz  from the 1860s and The Yellow Kid  from the 1890s are widely considered to be the first “real” comics. Since then, comics have developed into a genuine art form. Storytelling in this medium requires a clear flow of the story, well-composed images that clearly present the situations and actions, selective use of colors and contour lines that illustrate the shape of objects (and possibly also their color, texture and illumination). Some of the most famous comic artists are Carl Barks , Hal Foster and Will Eisner  from the U.S., Georges ‘Hergé’ Remi , Edgar P. Jacobs, Jacques Martin and André Franquin from Belgium, and Albert Uderzo, Jean-Claude Mézières and Jean ‘Moebius’ Giraud from France – just to name a few. In addition, there is the entire field of Japanese comics .
Animation presents an additional challenge: continuity in time. Masterpieces include the classic Disney movies , Tex Avery cartoons  and Japanese “anime” . To create a believable animation, the movements must have the right timing and follow some fundamental principles: squash and stretch, anticipation, follow-through, secondary action and exaggeration . Furthermore, the contour placement and style have to be consistent from frame to frame. Traditionally, a lead animator makes contour line drawings (“ink line” drawings) of the most significant poses of an animated character, then an assistant makes contour drawings of the frames in between (“in-betweening”) and finally color is painted in the spaces between the contour lines (“painting”). Since there are many frames per second of animation, the in-betweening and painting stages represent a huge workload.
Computer-Generated Contour Images
Computers offer advantages in modeling, animation and rendering of animations. For modeling, when an object has been modeled in 3D, it is easily viewed from all directions. For animation, it is often easier to get realistic movements with 3D models than with 2D projections, and the tedious in-betweening is done automatically. For rendering, the painting of each frame is done automatically. One might fear that artistic expression gets lost this way, but the challenging artistic tasks of developing the story, shapes and movements are still left to artists. The time-honored principles of traditional animation also apply to computer-generated animation!
One disadvantage of using computers is that modeling cartoon characters in 3D can be challenging. The traditional characters are usually conceived in 2D space, and some of them don't even have consistent 3D representations. For example, Mickey Mouse's ears are circular no matter what direction they are seen from. This is only true for a sphere. Nevertheless, his ears are supposed to be curved discs, not spheres – they are just always moving and turning perpendicular to the viewer. Aside from such problems, once the characters are modeled, the animation and rendering is much faster using computers than with traditional methods.
Computer-generated contours have been used in many movies, for example in the wildebeest stampede in Disney's The Lion King, in crowd scenes in The Hunchback of Notre Dame, in the Hun charge in Mulan , for a boat in Extrafilm's Asterix in America, in Ghibli Studios' Princess Mononoke, in Fox's Anastasia and in Dreamworks' Prince of Egypt. In the following two sections, the most important principles in computer-generated contour rendering are described.
The first decision to be made regarding contours is where they should be placed. Some possibilities are illustrated in Figure 1.
In Figure 1a, only the silhouette of each object has contour lines. Despite the simplicity, we get a sense of the shape of the objects — we can already recognize the ubiquitous “Utah teapot” — and we can see that one teapot is in front of another. In Figure 1b, there are interior lines in addition to the silhouette lines. The contours mark places with a large change in depth (distance to viewer) or surface orientation. Figure 1c shows contours between different colors. For this purpose, we have given the teapot a bright color at highlight regions, a medium color in illuminated regions other than highlights and a dark color in shadow (colors not shown). Figure 1d is a combination of 1b and 1c. This is close to the traditional placement of contours in comics and cartoons, where contours are drawn at places with a large change in depth or surface orientation to clarify shape and spatial relationships, and at the border between two colors to emphasize the colors and ease painting.
An object seen in a mirror or reflected in a lake should often have the same contours as if it were seen directly. Figure 1e shows contours on reflections. Similarly, there can also be contours on surfaces seen through transparent or refractive surfaces – Figure 1f shows an example of this.
Figures 1g and 1h show some nontraditional uses of contours. They both illustrate the underlying geometric representation. Figure 1g has contours at patch boundaries, showing that each teapot is represented as 32 surface patches. Figure 1h has contours at the edges of triangles, showing the triangulation of the teapots.
When the positions of the contours are determined, the next question is “How should the contours look?.'' There are two main parameters that determine the look of a contour: thickness and color. In the simplest contour style, all contours have constant thickness and color; this was the case for all the teapots in Figure 1.
Figure 2 shows some examples of more interesting contour thickness styles. A technique commonly used in traditional contour rendering is depth cue: the contour is thick if the object is near the viewer, and thin if the object is far away. Figure 2a shows an example of this. The contours in comics are sometimes drawn with an ink pen, in which case the contour is thick when the stroke is in one direction and thin in perpendicular directions. This gives a dynamic, artistic look. (This is rarely done in cartoons since it is difficult to maintain stroke directions from frame to frame.) Such an ink pen look is shown in Figure 2b. Figure 2c shows yet another style. Here, the contours are thin where the surface faces directly towards the light source, and thick where it faces directly opposite, with a continuous variation in between. With this style, the contour image gives an impression of illumination and shadows.
In other styles, the position of the contour can differ from the “correct” position. For example, the contour can be given a slight wiggle to simulate the tiny imperfections in traditional animations. A squiggly contour can indicate a rough, bumpy surface, or each contour line can be offset to simulate hand-drawn sketches.
Different objects in a scene can have different contour styles. For example, some objects can have thick contours for emphasis, or some objects can have sketchy contours to show that their shape is not final.
The contour color is also an important parameter. Figure 3 shows four different color contour styles. The top teapot in figure 3a has a contour with constant thickness and constant blue color. The contours on the teapot in front of it are colored by the underlying material: white around the highlight, yellow around other illuminated areas and brown around shadows. The color of the contours on the top teapot in Figure 3b is twice the material color, thus this contour indirectly depends on the illumination, color and texture of the material. The contour on the teapot in front of it is thick and red near the viewer and thin and blue further away; in addition, contours seen through this transparent material are only half as wide as they would otherwise be. This variation of thickness and color provides a very clear depth cue.
The contour color can also vary across the contour. For example, a glowing color can be obtained by varying the color and alpha from transparent on the edges of the contour to a solid color in the middle of the contour, or the color can change across the contour to generate a rainbow brush contour.
Some of the practical issues that are involved in computer-generated contour rendering are described in this section.
Some surfaces should not have contours between them – for example, if they are part of the same object, but have been modeled separately. Therefore, it is sometimes necessary to specify pairs of surfaces that should not have a contour between them.
When different objects in the same scene have different contour styles, an unavoidable issue comes up: which of the two contour types should be used at the image-space intersection between two objects? We have found that using the contour type of the frontmost object works well. However, no object is in front at places where two objects abut, so some other strategy must be used there. Examples of such strategies are: using a priority list (indicating which contour types have priority over which other types), using the average color and thickness or using the contour type for the surface where the normal faces most towards the viewer.
Contours can be on top of each other in image space. These contours need to be composited in the rendering process (or in a postprocess). Several strategies can be applied: the frontmost contour can be composited over the bottom one — using either alpha-blending or the brightest color in each color band — or the thickest contour can be chosen.
Per H. Christensen is working at mental images in Berlin, Germany. His work there focuses mainly on contour rendering, fast motion blur and global illumination. Before joining mental images, he received a Ph.D. in computer science from the University of Washington in Seattle, WA. The topic of his research was hierarchical finite-element methods for simulation of global illumination. In a previous life, he received a master’s degree in electrical engineering from the Technical University of Denmark.
Per H. Christensen
Contours are a powerful rendering paradigm – by themselves or combined with other rendering techniques. They are an important part of the artistic look of comics and cartoons. Contour images can be hand-drawn the traditional way, or they can be generated with computer rendering methods such as scanline rendering and ray tracing. mental ray, which is mostly known as a photorealistic renderer, also offers a flexible contour rendering shader interface and useful built-in contour shaders.
There are several avenues of further work in computer-generated contour images; one such avenue is motion contours. There are at least two different types of motion contours: blurry contours as if many contour images were superimposed (similar to motion blur in photorealistic renderings) and sharp “speed lines” in the direction of motion.
Thanks to my colleagues at mental images for ideas and suggestions during the development of the mental ray contour shader interface and contour shaders. Hoang-My Christensen and Rolf Herken provided valuable comments to improve the structure and readability of this article. The razorback model in Figure 4 is from Viewpoint Datalabs.