Life of Art

Have you heard of the Game of Life?

In brief, it is a thought experiment/zero-player game/mathematical marvel/construct that simulates, in a very rough manner of speaking, “life” and its interactions.

We start by looking at a grid of squares, say a 5-by-5.

Untitled.png

We randomly colour in some squares. These coloured squares represent life.

 

Untitled.png

 

These lifeforms go about populating and surviving based on a few simple set of rules:

  1. Each populated cell with one or no neighbors dies, as if by solitude.
  2. Each populated cell with four or more neighbors dies, as if by overpopulation.
  3. Each populated cell with two or three neighbors survives.
  4. Each unpopulated cell with three neighbors becomes populated.

 

In the example above, we can calculate what the grid will look like in the next time step. By labelling each cell (x,y) with (1,1) being the cell on the bottom left and (5,5) being the cell on the top right,

(1,1) is an unpopulated cell with 2 neighbours. It remains unpopulated.
(1,2) is a populated cell with 3 neighbours. It remains populated.
(1,3) is a populated cell with 4 neighbours. It dies.
(1,4) is a populated cell with 3 neighbours. It remains populated.
(1,5) is an unpopulated cell with 2 neighbours. It remains unpopulated.
(2,1) is an unpopulated cell with 4 neighbours. It remains unpopulated.
(2,2) is a populated cell with 5 neighbours. It dies.
(2,3) is a populated cell with 5 neighbours. It dies.
(2,4) is an unpopulated cell with 4 neighbours. It remains unpopulated.
(2,5) is a populated cell with 1 neighbour. It dies.
(3,1) is a populated cell with 4 neighbours. It dies.
(3,2) is a populated cell with 6 neighbours. It dies.
(3,3) is an unpopulated cell with 6 neighbours. It remains unpopulated.
(3,4) is an unpopulated cell with 5 neighbours. It remains unpopulated.
(3,5) is an unpopulated cell with 3 neighbours. It becomes populated.
(4,1) is a populated cell with 4 neighbours. It dies.
(4,2) is a populated cell with 5 neighbours. It dies.
(4,3) is a populated cell with 4 neighbours. It dies.
(4,4) is a populated cell with 3 neighbours. It remains populated.
(4,5) is a populated cell with 2 neighbours. It remains populated.
(5,1) is a populated cell with 2 neighbours. It remains populated.
(5,2) is an unpopulated cell with 4 neighbours. It remains unpopulated.
(5,3) is an unpopulated cell with 4 neighbours. It remains unpopulated.
(5,4) is a populated cell with 3 neighbours. It remains populated.
(5,5) is an unpopulated cell with 3 neighbours. It becomes populated.

 

And as such, we can work out how the diagram will look like in the next time step:

 

Untitled.png

 

And the time step after that.

 

Untitled.png

See if you can work out what it looks like the next time step! (Answer found in footnote)

Some configurations are statically stable, some oscillate. Most eventually decay into a mixture of both. Others eventually die out.

Maybe if I were other people, I would simply fascinate you with some animations and call it a day for this post. So here are some obligatory links here, here, and here.

Or, if I were other people, I would maybe show you how to code it. But I am not them, so I can link you to them instead.

What I am, however, is inspired. Inspired by my previous post.

You see, in the midst of doing Travel Colours, I got to learn more about colours and their applications. I got to better appreciate colours, both visually and by their hexadecimal values. I got to understand some of the various ways I could manipulate pictures.

And I got to ask myself, what if we could find a way to make pictures play the Game of Life?

So I took a picture of Starry Night by Van Gogh.

1280px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg

Using this picture as the reference image, I scaled it down for easier handling, and converted colours into a 9-bit system (where each channel has 8 possible combinations, making a total of 256 colours).

Can you tell which one is the original scaled down one, and which is the one with only 9 bit colour?

Untitled-1.jpg
Diagram illustrating how bit values for each picture was obtained

I then found the RGB values of each pixel, divided them by 32 (so there were only 8 buckets of values), then converted them into bit values. For example, in the diagram above, the R value for our pixel is 64, which is the third possible value (the 9-bit system that I had defined only allowed for pixel values of 0, 32, 64, 96, 128, 160, 192, 224, and 256), thus making it a “bit value” of 010.

With the bit values, we separated the picture into many “layers”, so the first “layer” would consist of the first digit of the “bit value” of the red value of the pixels, and so on.

Since the bit values were either 0 or 1, I could use all the ‘1’s to represent life, and ‘0’ the absence of it. Thus, I could make 9 Game of Life boards and initialise them. At every timestep, I would reverse the steps to recombine the bits into a colour, then display out the colour.

This was what they looked like unfolding.

starry
Animation of Starry Night undergoing the Game of Life (RGB)

Of course, RGB is not the only method of separating colours into their bit values.

starryhsv.gif
Animation of Starry Night undergoing Game of Life (HSV)

When I did these animations I had my limitations – use too large a picture or too many colours, and the calculations on the computer became much slower; use too small a picture with too many colours, and the results are inappreciable. For the above pictures I used 40 pixels and 256 colours, and you can tell that:

  1. The pictures quickly become unrecognisable.
  2. The HSV picture starts off off-coloured, because a small change in Hue (when doing the rounding) has a demonstrably great visual change in the final colour produced.

Of course, I didn’t want to go through this entire process just for one picture. Rather, I wanted to see what other pictures would look like if they played the Game of Life. Before doing so, I had to decide on a guideline as to when I wanted to stop the Game, which could theoretically go on forever. For a while I considered choosing an arbitrary value (44 came to mind, so did 50), but stumbled upon an article where someone found that for random 20×20 patterns, the mode lifespan was 164 steps. Not knowing how to scale that up for larger pictures, I decided to follow that idea.

Here are the results:

 

 

Starry Night, Van Gogh (1889)

This slideshow requires JavaScript.

 

The Creation of Adam, Michaelangelo (1512)

This slideshow requires JavaScript.

 

The Last Supper, Leonardo Da Vinci (1495 – 1498)

This slideshow requires JavaScript.

 

The Scream, Edvard Munch (1893)

This slideshow requires JavaScript.

 

The Persistence of Memory, Salvador Dali (1931)

This slideshow requires JavaScript.

 

Girl with a Pearl Earring, Johannes Vermeer (1665)

 

 

This slideshow requires JavaScript.

 

Regarding the above question about the next timestep, it dies.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s