danomatika’s portfolio

Cellular Imagery

An image filter based on a cellular automata framework – not one filter, but an infinite variety.

March 2006

Cellular automata are mathematical models where a grid of individual cells react with their neighbors based on a series of simple rules. Each cell has a specific state, usually represented by color.

The most well-known cellular automaton is mathematician John Conway’s Game of Life where cells in a 2 dimensional grid hold one of 2 states: “alive” or “dead”. The state of each cell is based on the states of the 8 neighbors by a simple set of rules:

  • a live cell dies if:
    – it is lonely: fewer then 2 neighbors are alive
    – it is overcrowded: 4 or more neighbors are alive
  • a live cell lives if 2 or 3 neighbors are alive
  • a dead cell comes to life when 3 neighbors are alive

From such a simple framework comes an almost biological process where different structures move about and interact until the whole system reaches equilibrium – only unmoving or oscillating structures are left. There is a whole science based on using cellular automata to represent numerous natural systems.

See my implementation of the Game of Life

———————————————————————-

Cellular Imagery is a 2 dimensional cellular automaton where each cell is a pixel in an image. Like the Game of Life, each cell can either be “dead” or “alive” and the state is determined by the states of its neighbors. RGB color information, however, is also incorporated into the rule set and the state can also be determined by the amount of color information in the neighbors. The color of individual pixels can be changed when the state is changed.

The system is setup for experimentation. There are 5 parameters that can be tweaked:

  • FILTER: a basic rbg filter to choose if a cell sees a live neighbor as “alive”
  • TWK_ALIVE: the number of live neighbors needed for a dead cell to come alive
  • TWK_DEAD: the number of live neighbors needed for a live cell to die
  • RESURRECT: how to change the color of the the pixel when it comes alive
  • SMITE: how to change the color of the pixel when it dies

There is also an option to toggle if the dead cells are shown.

Most of the individual filters in the following pictures were found as I changed parameters. I did not set out to design a single filter, but to build a program that would surprise me as I played with it, much like cellular automata has done for countless mathematicians and programmers.

This is a different approach for me as my engineering background has ingrained a “build towards a specific goal” mentality. I “went along for the ride” and ended up with something much more interesting then anything I could have imagined.

———————————————————————-

Cellular Imagery Gallery
Here are some example images:

This is the original, Rene Magritte’s non-pipe.
A blue flame wafting to the right.

A red flame held within.
Green structures.
A destructive hollowing within.

———————————————————————-

Watch a video of this filter devouring the inside of the non-pipe.

devour

———————————————————————-


Leave a Reply