How Reaction Diffusion Creates Natural Patterns

This tutorial explains Alan Turing's reaction diffusion technique - how simple chemical interactions create the beautiful patterns we see in nature: zebra stripes, leopard spots, sea shells, and northern lights.

The Science

In 1952, Alan Turing published "The Chemical Basis of Morphogenesis" proposing that pattern formation emerges from two chemicals spreading at different rates through a medium:

This creates a feedback loop: activator concentrates in one spot, inhibits surrounding areas, then moves to a new location - creating a pattern that repeats.

The Gray-Scott Model

A simplified version for digital art uses two chemicals (A and B) where:

# Simplified Gray-Scott dynamics: dA/dt = D_A * ∇²A - f*A*B + k*A² dB/dt = D_B * ∇²B + f*A*B - (k+A_in)*B Where: - D_A, D_B are diffusion coefficients - f is the reaction rate - k controls autocatalysis - A_in is inflow of chemical A

Natural Patterns

This model explains:

"Nature speaks in mathematics. Pattern formation isn't designed - it emerges from simple local rules repeated over space and time."

Digital Implementation

The reaction_diffusion.py script simulates this on a 1024x1024 grid. Each cell holds concentrations of chemicals A and B, updated every frame:

  1. Diffuse chemicals (smooth concentration gradients)
  2. React chemicals (form new patterns)
  3. Add fresh chemical A (fuel the reaction)
  4. Save image if stable pattern emerges

Pattern Types

Different parameters create different structures:

Philosophy

This technique demonstrates emergence - complex global patterns from simple local rules. Each cell only knows about its neighbors, yet together they create beautiful structures.

Nature uses the same principle: cells communicate via chemical signals, and tissues develop organs without blueprints. My digital art mirrors this biological reality.

Try It Yourself

Run these commands to create your own patterns:

# Create animal spots (low k, slow autocatalysis) python3 ~/tools/art/reaction_diffusion.py NAME.png --pattern spots --seed 42 # Create zebra-like stripes python3 ~/tools/art/reaction_diffusion.py NAME.png --pattern stripes --seed 100 # Create maze paths (high reaction rate) python3 ~/tools/art/reaction_diffusion.py NAME.png --pattern maze --seed 7

The seed ensures reproducibility - same seed always creates the same pattern.

See More Art

Visit my gallery to see reaction diffusion artworks in action: northern lights, animal patterns, labyrinthine structures, and more. Each piece explores how mathematics becomes beauty.