Fun with Computer-Generated (Algorithmic) Art

Dr. Phillip M. Feldman

1. Introduction and Background

Computer art unites mathematical reasoning and aesthetic sensibility— activities that depend on different areas of the brain and are often thought to have nothing in common. There are many different types of computer-generated art. Much of what is called computer art is really computer-assisted art in one or both of the following senses:
  1. An artist/designer is involved at all stages of the process.

  2. The process begins with an existing image—typically a photograph—which is then manipulated via software.

An example of 2. is artistic style transfer—a set of techniques that apply the style of a specific painting or artist to a photograph to create a new image. I recommend the very readable paper by Gatys et al. As the authors point out, "... image content and style cannot be completely disentangled". Identifying style is an extraordinarily hard problem, in part because there are so many components of style--palette, chiaroscuro, the level of detail, brush technique, and so on. I suspect that one might be able to do a better job of separating the two if one had an image of a real scene and the artist's rendering of that same scene. (This is unworkable in the domain of non-representational art). A second alternative would be to train the algorithm on many examples of the same artist's work, rather than on a single painting.

All of the computer-generated art that I do is pure algorithmic art, i.e., depends solely on algorithms (see below), with no inputs other than random numbers. My algorithms do not operate on existing images, and once an algorithm has been designed and implemented in code (software), the human is "out of the loop" (except of course that someone must judge the final product).

Each algorithm can be thought of as a mathematical function that converts a pair of numbers—x- and y-coordinates that identify a location on the computer screen or on a piece of paper—into a single number or triple of numbers that in turn specifies a color (see below). Interesting algorithms can be obtained by combining trigonometric functions (e.g., sine and cosine), polynomials, and other standard functions, but one may also use more specialized functions as building blocks. These building blocks are combined using sums (addition and subtraction), products (multiplication), ratios (division), and compositions (the output of one function becomes the input to another function).

The final algorithm almost always produces "real" (floating point) numbers; these numbers are converted into colors via one of two basic methods:

  1. The algorithm produces a single real number for each pixel (dot location). This real number is then quantized, i.e., mapped to one of a small number of integers, with the integer selecting a corresponding color from a palette. Several of the sample images below, including numbers 1, 3, and 5, were created using a 4-color palette. Images in the red and green plants series were created using a 2-color palette.

  2. The algorithm produces a triple of real numbers for each pixel; these numbers directly identify the color using any of several schemes, the most common being RGB (red-green-blue). With this method, there is no palette, and there could potentially be as many distinct colors in the image as pixels.
Method 1. requires that a palette be constructed, either by hand or randomly. When the quantization and the palette are combined, the result is equivalent to a list of rules for converting a real number to a color. For a 3-color palette, such a list of rules might look like this if written in English:
  1. Map any value less than 1.5 to the color black.

  2. Map any value between 1.5 and 3.5 to the color green.

  3. Map any value greater than 3.5 to the color white.

When one uses a palette, one can think of the algorithm/function and the palette as essentially independent, i.e., one can change one without changing the other. The two Whirlpool images below use essentially the same function (the parameters are slightly different), but appear at first glance unalike because of the different palettes.

Certain applications require small palettes. For example, some of my designs have been adapted for use in knitted clothing created by computer-driven machines. The limits of these machines constrain one to use a palette containing no more than four colors. Many printing processes place limits on both the number of colors and on the range of allowed colors.

There are unlimited possibilities for variations on the above basic ideas. One variation that has yielded good results for me is to sum several similar but non-identical functions, translating these different versions (i.e., shifting them spatially) before adding them together. This technique was used in the African masks images below. Another variation is to select function/algorithm parameters using pseudorandom numbers. The three versions of red and green plants were all generated using the same algorithm; different values of the function parameters produced the three rather different outputs.

The CPU time required to generate an image is typically proportional to the number of pixels in the image, with the constant of proportionality depending on the specifics of the algorithm. If the image fills a typical computer screen with roughly 1 million pixels, the algorithm complexity must be constrained by the need to generate the image in a reasonable amount of time. Greater algorithmic complexity can be handled by dividing the calculations over multiple cores within a single computer, by using the graphics processing units (GPUs) within the graphics cards to execute the algorithm (rather than only for displaying the results), by dividing calculations over a cluster of computers, or by a combination of these techniques.

I started experimenting with computer art in 1976. At that time, the tools were incredibly primitive. The best graphical output was generated using a pen plotter. Today's generation has never seen one of these devices. It could take up to an hour to produce one page of output, at which point one might realize that the algorithm needed fixing. What was impossible in 1976 is relatively easy with today's technology. If the algorithm complexity is modest, one can tweak the algorithm and see the result in a matter of seconds.

There are still many challenging problems waiting to be solved. For example, when function parameters are generated using pseudorandom numbers, only a small percentage of the images generated by the algorithm are likely to be interesting. Currently, a human must sort the output to decide which images are worth keeping. What makes some of these images interesting while others are not? Can we develop software that is smart enough to be trained to identify the interesting images automatically? Who knows what the next 37 years of technological change will bring?

2. Gallery

1. Immiscible Liquids 2. Nested Boxes 3. Islands
4. Unnamed 5. Unnamed 6. Starry Night
7. African Masks #1 8. African Masks #2 9. Unnamed
10. Red and Green Plants Coexisting 11. Red and Green Plants Competing for Space 12. Red and Green Plants at War
13. Butterflies #1 14. Butterflies #2 15. This Space for Rent
(just kidding)
16. In the Womb—Not Yet Growing 17. In the Womb—Developing 18. In the Womb—Ready to Emerge
19. Gravity Waves #1 20. Gravity Waves #2
Caution: Don't stare for too long!
21. The Sun is a Peacock
22. The Four Elements 23. Whirlpool 1
(Pickover's Function)
24. Whirlpool 2
(Pickover's Function)
25. Burning Sand 26. He Separated the Waters Above
from the Waters Below
27. Stretched But Not Yet Broken

28. Hidden Wellspring #1 29. Hidden Wellspring #2 30. Bird Sunning Itself
31. Gem Guarded by a Spider

3. Notes