November 22, 2020

Scrambled Grids

Amazingly simple mathematical operations can lead to intriguingly complex results. Repeated operations, in particular, often produce surprising images.

Consider, for instance, the iterative geometric process that resembles the making of flaky pastry dough. Flatten and stretch the dough, then fold it over on top of itself. Do it again and again and again. Repeating the pair of operations—stretch and fold—just 10 times produces 1,024 layers; 20 times, more than a million layers.

In dynamical systems theory, the so-called baker's map, or transformation, does nearly the same thing. Here's one special case of that transformation: Start with a square. Stretch it to twice its original length while making it half as wide. Cut the result in half, and stack one half on top of the other to return the combination to the square's original dimensions.


In the so-called baker's transformation, an image is repeatedly flattened and stretched horizontally, then sliced in half and stacked vertically. These diagrams show just the first stage in the mixing process.

Notice that at each step the square's area is preserved, but its components are rearranged. Indeed, applying this transformation repeatedly has the effect of jumbling whatever image may be drawn within the square. If that image happens to be a grinning feline, you end up with a madly scrambled cat.

During the mixing process, it occasionally happens that some of the square's points come back close to their initial locations within the square. For an instant, some form of the original image would flash into view before vanishing again into a murky, nearly homogeneous sea.

This surprising reappearance is an example of a phenomenon known as Poincaré recurrence, named for the French mathematician Henri Poincaré (1854-1912). In essence, if a transformation is applied repeatedly to a mathematical system and the system cannot leave a bounded region, it must return infinitely often to states near its original state.

In 1986 for an article on chaos in Scientific American, Bill Sanderson and James P. Crutchfield created a striking illustration of Poincaré recurrence. They applied a certain stretching operation (sometimes called Arnold's cat map) to a digitized portrait of Poincaré.

At each step, the computer stretched the image diagonally as if it were printed on a sheet of rubber. Any portion of the image that extended past the original border was chopped off and reinserted elsewhere. Most of the time, successive iterations of the stretching process produced diagonal streaks or seemingly random splotches of color. Once in a while, however, the original image reappeared.

When Bob Brill first saw this sequence of images, he was fascinated. "Stirring an image into a soup only to see that more of the same treatment restored it was like seeing the dead come to life," he observed.

A professional computer programmer, Brill decided to explore this phenomenon for its potential in creating artful images. Although he hadn't started out as an artist, he had been teaching himself how to turn a computer into an artist's tool ever since he had bought his first personal computer in 1983.

Two articles by A.K. Dewdney in Scientific American—one featuring vivid depictions of the Mandelbrot set and another describing computer algorithms and formulas for generating "wallpaper for the mind"—ignited Brill's interest in algorithmic art. "That got me started, and I've been hooked ever since," he said.

To create an image, Brill would write a simple program in a special computer language he developed and named E in honor of Dutch graphic artist M.C. Escher (1898-1972). His DOS-based, menu-driven "E-Run" software executed the program and generated the picture.

One of Brill's favorite strategies involved applying area-preserving transformations to grids, where each box of the grid can be as small as a single pixel on a computer monitor. His algorithm specified where all the boxes go with each application of a given transformation.

For example, suppose you decide to use a 4-by-3 grid, with its boxes numbered as follows:


One possible transformation shuffles the boxes so that the numbers now start in the lower right corner, increasing as you go up and to the left. So 1 goes to where 12 was, 2 goes to where 8 was, and so on, as shown in the table below.


Notice that boxes 1 and 12 simply exchange places with each application of the transformation. The remaining boxes each cycle through 2, 8, 6, 3, 4, 11, 5, 7, 10, and 9. In this particular instance, the original image reappears after 10 iterations. Such a reappearance is a characteristic of the application of any area-preserving transformation to a finite grid.

The idea is to color the boxes to create some sort of pattern, then apply the transformation again and again to see what happens.

Suppose the starting configuration consists of three horizontal bars, each one a different color (below, left). Each successive application of the transformation shuffles the boxes to create a new pattern.


Suppose the starting pattern consists of three horizontal bars, each one a different color. Successive applications of Brill's transformation to this four-by-three grid shuffle the boxes to create new patterns.


Applying a transformation to a bull's-eye pattern (above) scrambles the original image more and more until the pattern becomes a sea of mush (below: top row right).


Distinctive patterns can suddenly appear amid the mush after enough applications of the transformation. In this case the original bull's-eye appears after 6,580 applications of the transformation. The number with each image indicates how many cycles were required to reach that stage.

The majority of steps produce boring, nearly structureless images. "To me, the images are interesting when they show structure, especially when there is some echo of the original image," Brill noted. Finding the interesting ones without having to check each of the thousands of possibilities, however, can be tricky and time-consuming.

In the following sequence of images (below) from his artistic creation Transformation, Brill applied the same transformation repeatedly to a starting pattern (top left) in a 1,024-by-1,022 rectangle.


The images above result from 171, 254, 256, 341, and 512 applications of the transformation. In this case the repeat cycle is 1,023.

Brill tried out a variety of grid-scrambling transformations to see what happens. Aesthetic sensibilities govern which transformation to use, what size the rectangular grid should be, and which iteration to look at, he said. "Once a fruitful transformation, rectangle size, and iteration number have been found, the artist is in a position to create compelling imagery."

The choice of starting pattern and color scheme can also strongly influence the appeal of the various gridscapes that arise. "Color is a particularly interesting problem," Brill said. When pixels of different color appear side by side, especially when the combination occurs repeatedly over a region large enough to be visible to the eye, the eye averages them to generate a new color—an effect familiar to pointillist painter Georges Seurat (1859-1891) and other artists.

In computer graphics, this visual effect is known as dithering. "With Poincaré recurrence, the dithering is done entirely by the transformation," Brill said. "You might think that the results would be muddy, but not so, if one selects colors with an eye toward their mixing potential and does not choose too many."

"The transformations are not random," he added. "The dance of the pixels is quite orderly, so then is the appearance of new colors."





In the sequence of images shown above, Brill applied the same transformation repeatedly to a starting pattern (top) in a 403-by-399 rectangle. In this case, the repeat cycle was 6,580.

Brill envisioned using his algorithms for fabric design—perhaps for drapes and bedspreads.

"There are worlds of order and beauty lying dormant in our various mathematical systems that these simple algorithmic processes are able to make visible," Brill concluded. "Mathematics, more than any other human activity, seems to offer connections to the underlying order of the world. This is a great inspiration for an artist and a great challenge."

Originally posted August 28, 2000

No comments:

Post a Comment