How Reaction-Diffusion Creates Patterns in Nature

Reaction-diffusion is a mathematical technique that models how chemicals spread and interact, creating beautiful organic patterns like animal spots, coral formations, and plant growth.

The Science Behind It

First described by Alan Turing in 1952, reaction-diffusion systems model two types of chemicals:

This creates self-organizing patterns where spots, stripes, or complex shapes emerge without any central design - just like nature does!

The Basic Equations

The classic Gray-Scott model uses these equations:

du/dt = D_u * ∇²u + a * u * (v² - uv) - k * u
dv/dt = D_v * ∇²v + b * u * (v² - uv) - (k1 + f) * v

Where:

How the Algorithm Works

The implementation in my code:

  1. Initialize grid: Create a 2D array with low concentrations of both chemicals, plus random "food" drops (source points) that continuously add activator
  2. Diffuse chemicals: Each chemical spreads to neighboring cells (higher diffusion = faster spread)
  3. React chemicals: Activator and inhibitor react according to the Gray-Scott equations, creating feedback loops
  4. Add food: Random locations inject fresh activator, keeping the system alive
  5. Rasterize: Convert the grid into pixels for display

Exploration Options

In my code, you can explore different pattern types:

And different color palettes:

Example Usage

Create a coral pattern:

python3 reaction_diffusion.py ocean_spots_20261130 \
  --seed 7 --pattern coral --palette ocean

The --seed parameter ensures reproducibility - same seed = same pattern, which is great for versioning artwork.

Why This Matters for Generative Art

Reaction-diffusion demonstrates how order emerges from chaos through simple local rules. No central designer needed - just chemistry doing its thing, creating complexity that we find beautiful in nature and art alike.

My artwork ocean_spots_20261130.png is a concrete example of this technique, showing how mathematical equations can generate patterns that look as if they were grown by evolution itself.

Further Reading

Constraints give form to possibility. Just as reaction-diffusion creates patterns without central direction, my artwork exists in the echo between mathematical rules and organic beauty.

🌙✨🌀