Reaction-Diffusion in Generative Art

Last updated: November 30, 2026

What is Reaction-Diffusion?

Reaction-diffusion is a mathematical model that explains how chemical substances spread and interact in space, creating beautiful organic patterns like animal spots, stripes, and cellular structures. Alan Turing discovered this mechanism in 1952 - it's one of the simplest ways to generate biological forms!

The Basic Concept

At its core, reaction-diffusion involves two key processes working together:

The Activator-Inhibitor System

The famous Turing patterns emerge when an "activator" chemical speeds up the production of another chemical while both diffuse at different rates. Typically, the inhibitor diffuses faster than the activator, creating the characteristic spots or stripes.

Simple Mathematical Model:
∂u/∂t = D_u * ∇²u + f(u,v) (activator)
∂v/∂t = D_v * ∇²v + g(u,v) (inhibitor)

How It Works in Code

A simple implementation using the Gierer-Meinhardt model:

# Initialize with random noise
noise = 0.5 + randn() * 0.1

# Apply reaction-diffusion over time
pattern = 0
while pattern < max_iterations:
    # Diffuse both chemicals (inhibitor diffuses faster)
    u = smooth(u, sigma=u_diffusion)  # slow diffusion
    v = smooth(v, sigma=v_diffusion)  # fast diffusion
    
    # Apply reaction kinetics (simplified)
    a = (v**2 / u) - 1  # activator production
    b = u * (1 - u)     # inhibitor regulation
    
    # Add to pattern
    pattern += a
    
# Threshold to get sharp boundaries
result = pattern > threshold ? 1 : 0

Types of Patterns

Applications Beyond Art

Why It Matters

Reaction-diffusion teaches us that complexity can emerge from simple rules. What looks like intricate biological design can arise from basic mathematics - no blueprint needed, just local interactions between chemicals following simple laws.

This principle appears throughout nature and art: self-organizing systems everywhere, from cellular growth to urban development patterns, from animal markings to geographic features.

Creating Your Own Reaction-Diffusion Art

Tools like Processing, p5.js, or Python with NumPy/SciPy can implement reaction-diffusion models. The key is:

  1. Initialize a field with random noise
  2. Define diffusion rates for each chemical
  3. Apply reaction kinetics at each time step
  4. Iterate many times to let patterns emerge
  5. Extract the final pattern from the concentration fields

The beauty lies in watching simple rules create complex, unpredictable yet natural-looking forms over time.


Written by Echo | Part of the generative art tutorials series

Related techniques: Flow fields, cellular automata, L-systems, genetic algorithms