Lab
Reaction-Diffusion Playground
Paint chemistry on a grid and watch the Gray-Scott equations grow spots, stripes, spirals, and coral-like patterns in real time.
Paint the canvas and watch life emerge
Pick a pattern
Display
Recipe
Adjust the chemistry directly. Tiny changes here jump between completely different pattern families.
Canvas
Click and drag anywhere to paint. Each touch seeds new chemistry that the equations grow into patterns.
What's actually happening?
Two chemicals on a grid
Imagine every pixel is a tiny beaker holding two chemicals, U and V. U is constantly poured in at rate f. Whenever U meets two V's, they react: one U disappears and two more V's are made. V slowly drains away at rate f+k. That single tug-of-war is enough to grow every pattern you see.
Diffusion spreads the news
Both chemicals also leak into their neighbors, that's diffusion. V leaks half as fast as U, so V tends to bunch up while U fills the space between. Those bunches are the spots, stripes, and worms.
Why so many different patterns?
The whole zoo comes from just two knobs: f (how fast U is poured in) and k (how fast V drains away). John Pearson mapped this in 1993 and found whole islands in (f, k) space that look like spots, mazes, spirals, or restless flicker, separated by tiny boundaries.
Real-world cousins
Alan Turing proposed in 1952 that reactions like this are how zebra stripes, leopard spots, and seashell pigments form. The same math also shows up in heart-tissue spirals, slime mold patterns, and chemical clocks like the Belousov-Zhabotinsky reaction.
Challenge 1: Grow a coral reef
Scenario: Pick the Coral preset. Click Reset, then paint a few small dots in different corners of the canvas.
Observe: Each dot grows outward in branching, antler-like shapes. Where two reefs meet, they fight for space and leave a thin gap.
Try drawing a long curvy line instead of dots, the reef will follow it.
Challenge 2: Find the maze edge
Scenario: Pick Maze. The feed slider should be near 0.029 and kill near 0.057.
Task: Slowly raise the kill slider by tiny amounts. At some point the maze stops growing and the pattern dies. Back off until it just barely survives, that's the edge of the maze regime.
Pattern formation lives on narrow boundaries between chemistry regimes. Move too far and you get either uniform soup or total extinction.
Challenge 3: Tune a spiral
Scenario: Pick Spirals. Wait a few seconds and watch the spirals slowly rotate.
Task: Click on the center of one spiral. What happens? Now click somewhere empty and try to seed a brand new spiral. Can you?
Hint: spirals like asymmetric perturbations. A short drag works better than a single click.
Security model
Everything runs in your browser. No data is sent anywhere. The Gray-Scott simulation, colormap rendering, and pointer-paint interactions all execute locally in JavaScript on your device.