Art Machine


Sample program output

A still from Rebalanced

Rebalanced is a code art piece written by Tim Brook for the exhibition Art Machine. It brings together a number of disparate themes.


The ideas behind Rebalanced are derived from an odd assortment of sources—

The four-colour exercise

Joseph Albers instructed his students to begin their study of colour as a quality its own right. It was to be separated, as far as possible, from form and meaning. To this end he devised a number of apparently simple exercises using coloured paper. Later he laid out detailed reasons to justify this choice of medium.

In one of these exercises, students were asked to select paper in four colours. They were then required to paste up a sequence of torn strips of paper to create a colour composition.

Rebalanced uses a Java program to simulate this process each time an image is submitted to Art Machine

  1. Four colours are selected from the theoretical cardinal points of the image rectangle
  2. The order of the colours and the width of the strips is determined by a Markov chain
  3. Torn edges are simulated by adding random variations to the widths of the strips
  4. The colour combination is then modified four times, each time replacing one of the original colours with a colour that produces a formal balance
  5. Whenever two of the selected colours are very similar, one of them is overlaid with text from the source code of the program

At any stage a viewer is able to tear through the surface layers to reveal part of the image from which the coloured strips were derived.

The Markov chain

The coloured strip next to this paragraph is being controlled by a Markov chain. At fixed intervals (about 1 second) the strip is redrawn in one of four possible colours. Each time it’s drawn, the colour depends on the previous colour and on some transition probabilities. The probabilities are weighted so the colour is most likely to stay the same, but there is still some chance it will change to any one of the other colours.

In this way both the time and nature of each colour change is unpredictable but the overall structure of the process remains under control.

Rebalanced uses the same transition probabilities to lay out the coloured strips. Working from left to right across the canvas, strips of colour are laid down at fixed intervals (25 pixels). Each time a strip is drawn, the colour depends on the previous colour and on the transition probabilities.

Pixel averaging

Each time Rebalanced modifies a colour selection, the colours are adjusted so that the overall average is mid grey.2 This process takes account of the total area occupied by each colour. It is the same process as the automatic colour adjustment used to make cheap prints from photographs. The result is a colour composition that is balanced or harmonious in a purely formal sense.

Albers’ explanation

What are the advantages of working with color paper?

First, color paper avoids unnecessary mixing of paints, which is often difficult, time-consuming, and tiring. This is true not merely for beginners alone.


Second, by not exposing the student to discouraging failures of mixing and imperfect matching of spoiled paints and papers, we not only save time and material, but, more important, gain a continued active interest.

Third, color paper permits a repeated use of precisely the same color without the slightest change in tone, light, or surface quality. It permits repetition without disturbing changes caused by varying application of paint (thinner or thicker—even or uneven); without traces of hand or tool resulting in varying density and intensity.

Fourth, working with color paper rarely demands more equipment than paste (heavy rubber cement is best), and a single-edged razor blade instead of scissors. This eliminates tools and equipment for handling paints, and therefore is easier, cheaper, and more orderly.

Fifth, color paper also protects us from the undesired and unnecessary addition of so-called texture (such as brush marks and strokes, incalculable changes from wet to dry, or heavy and loose covering, hard and soft boundaries, etc.) which too often only hides poor color conception or application, or, worse, an insensitive color handling.

There is another valuable advantage in working with color papers instead of with paints: in solving our problems again and again we must find just the right color which demonstrates a desired effect. We can choose from a large collection of tones, displayed in front of us, and can thus constantly compare neighboring and contrasting colors. This offers a training which no palette can provide.

Josef Albers1

Albers doesn’t list all the reasons for not trying to understand colour by mixing paint. There are many other reasons that might also be listed.