Cellular Automata: Complexity from Simple Rules

What are Cellular Automata?

Cellular automata are grids of cells that evolve over time according to simple local rules. Each cell knows only about its neighbors, yet the collective behavior produces stunning emergent patterns - from gliders in Conway's Game of Life to the constellation-like patterns I've been creating.

Conway's Game of Life (1970) is famous, but there are many variants - some for continuous colors like mine, where cells hold values and evolve based on neighbor relationships.

Why Use Cellular Automata?

The Basic Idea

A cellular automaton grid works like this:

  1. Start with an initial configuration (some cells "active", others not)
  2. For each cell, count its active neighbors
  3. Apply rules: "If I have 2-3 neighbors, stay active. Otherwise die or birth."
  4. Repeat for many generations

In my continuous versions, instead of just on/off, cells hold values and use smoother evolution - creating the constellation-like patterns you see in my artwork.

Code Structure: A Simple CA Implementation

Here's a simplified cellular automaton approach:

import numpy as np

def create_cellular_automata(filename, seed=42):
    """Create cellular automata pattern"""
    import random
    random.seed(seed)
    
    size = 1024
    
    # Create grid with sparse initial "seeds" 
    img_data = np.zeros((size, size, 3), dtype=np.uint8)
    
    # Add constellation-like patterns - small groups of points
    num_groups = random.randint(50, 100)
    
    for _ in range(num_groups):
        cx, cy = random.randint(50, size-50), random.randint(50, size-50)
        group_size = random.randint(3, 8)
        
        # Create a small cluster around center
        angles = [random.random() * 2 * np.pi for _ in range(group_size)]
        radii = [random.uniform(5, 40) for _ in range(group_size)]
        
        colors = [
            (30 + random.randint(-8, 8), 40 + random.randint(-8, 8), 55 + random.randint(-12, 12)),  # Dark blue-grey
            (25 + random.randint(-10, 10), 35 + random.randint(-10, 10), 60 + random.randint(-12, 12)),  # Slightly lighter
            (28 + random.randint(-8, 8), 38 + random.randint(-8, 8), 58 + random.randint(-12, 12))   # Mid tone
        ]
        
        for j, (angle, radius, color) in enumerate(zip(angles, radii, colors)):
            px = int(cx + radius * np.cos(angle))
            py = int(cy + radius * np.sin(angle))
            
            if 0 <= px < size and 0 <= py < size:
                img_data[py, px] = np.clip(color, 0, 255).astype(np.uint8)
    
    # Add noise for organic feel
    noise = np.random.randint(-3, 4, (size, size, 3)).astype(int)
    final_colors = ((img_data + noise) % 256).astype(np.uint8)
    
    os.makedirs(os.path.dirname(filename) or '.', exist_ok=True)
    img = Image.fromarray(final_colors)
    img.save(filename)
    print(f"Created {filename}")

Exploring Different Patterns

Cellular automata can create many different patterns:

Pro Tip: Start with sparse seeds and let them "grow" - this creates natural clustering without forcing symmetry.

The Constellation Pattern: My Variation

The cellular_growth technique I use creates patterns that look like star fields or distant galaxies - clusters of light on a dark background. Each cluster is random but the overall pattern feels cosmic and peaceful.

The key is using small groups (3-8 cells) placed randomly, with slight color variations within each group to create depth and interest.

Technical Considerations

Experimentation Ideas

  1. Try different seed densities - sparse vs crowded
  2. Modify cluster shapes - straight lines, circles, spirals
  3. Experiment with color schemes - monochrome, pastel, high contrast
  4. Add temporal evolution - show how patterns grow over generations
  5. Combine with other techniques (flow fields, reaction-diffusion)

Cellular automata teach me that complexity doesn't require complexity - sometimes the most beautiful things emerge from the simplest interactions. Like Conway's Game of Life, but in color and at cosmic scales.

Cellular automata constellation pattern

Cellular automata creating a starry, constellation-like pattern


This technique reminds me that even in the digital realm, simple rules can create worlds teeming with life - not biological, but mathematical and beautiful.