# Game of Pixel

To Matt Pearson, who taught me that coding is poetry.

Conway’s Game of Life (GOL) is a **cellular automaton** devised by the British mathematician John Horton Conway in 1970. The game evolution is determined by its initial, typically random, configuration, requiring no further input. One plays with the Game of Life by creating an initial configuration and observing how it evolves.

GOL purpose is to show how **complex behaviors** similar to life can emerge from **simple rules** of interaction between many bodies. The game takes place on an infinite grid of square cells called the world. Each cell has 8 neighbors, which are the cells adjacent to it, including those along the diagonal. Each cell can be in two states: alive or dead. The game evolves in discrete time intervals and the states of all cells at a given time are used to calculate the state of cells at the next instant. All the cells of the world are updated simultaneously in passing from one moment to the next: a generation passes. The state transition rules depend solely on the number of living neighbors:

- Any live cell with fewer than two live neighbors dies, as if by underpopulation.
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies, as if by overpopulation.
- Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

I coded a variant of GOL called **Game of Pixel** (GOP) in Processing. I start from a bitmap image and represent each image pixel as a cell of the GOL. As for the initial configuration of the game, I adopted the following rule:

If relative luminance of a pixel is larger than a noisy value around 0.5, then the pixel cell is alive, otherwise it is dead.

I computed relative luminance (L) as usual:

`L = 0.2126 * R + 0.7152 * G + 0.0722 * B`

where R, G and B are the red, green, and blue components (rescaled in the interval [0,1]) of the pixel’s color, respectively. Green light contributes the most to the intensity of brightness perceived by humans, and blue light the least.

Given this initial configuration, I let the game run on a selected image and applied the following rule at each generation of the game:

If a pixel is alive it is pictured with its complementary color, otherwise with its original color.

The effect is as if images are invaded by a colony of **artificial life** that feeds of pixels, expanding along unpredictable paths, apparently never ending. In fact, since any image has a finite number of pixels, the possible configuration states of the game is also finite, and hence eventually the game repeats itself. However, when this will happen is not easy to predict in advance:

The distinction that’s new, and that we didn’t used to make, is that something can be deterministic but not predictable. We tend to think they are synonyms but they’re not. Something can be obeying some law of nature but it’s not predictable because what it’s doing is so complicated that the time it would take you to calculate what it was going to do would take longer than the thing actually doing it. So you could compute it but you can’t compute the world any faster than it is happening. Rudy Rucker

It is proved that the original Game of Life has the power of a universal **Turing machine**: anything that can be computed algorithmically can be computed within it.

As a child that fancies about alien life, I love to dream that these images are telling something, computing answers, giving hope.

The following images are a selection of those I produced using Game of Pixel.