Reaction Diffusion Pattern Lab

Two chemicals, two numbers, and spots turn to stripes.

  • Gray-Scott model
  • Paint and steer live
  • Seamless textures
A ceramic tile with teal spots and winding labyrinth stripes like coral, resting on a desk beside color swatches.

The guide

Spots and stripes from two numbers: what reaction and diffusion can and cannot explain

Two chemicals that react and spread at different rates will draw spots, stripes and mazes by themselves. The hard part is knowing when nature really does it that way.

  • 1952 Turing publishes the idea
  • 2 numbers feed and kill choose the pattern
  • 12 patterns named by Pearson with Greek letters
  • 75 of 255 scanned points that kept a pattern
  • 1 of 1.25 time step used, against the limit
Read the full guide Fold the guide 7 min · 12 sources

Diffusion is the great leveller. A drop of ink in water spreads until the glass is one even gray, and nothing about that process suggests it could ever paint a leopard. Yet in 1952 Alan Turing argued that diffusion, joined to the right chemistry, does the opposite: it can take a mixture that is the same everywhere and make it uneven, in a regular way.

His model, as a commentary written for the Royal Society’s anniversary puts it, showed how random fluctuations can drive the emergence of pattern and structure from initial uniformity. Chemicals that diffuse and react may produce neither bland uniformity nor disorderly chaos but something in between. Turing called the ingredients morphogens, shape-formers, and tied the abstract result to a concrete question: how a ball of identical cells becomes an animal.

For simplicity he studied a circular ring of cells. One two-dimensional pattern he calculated by hand looks like a dappled animal marking. That blotch is the ancestor of every simulated coat since.

Why uneven spreading makes order

The condition that matters is a difference in speed. Twenty years after Turing, Alfred Gierer and Hans Meinhardt reached a parallel theory without knowing of his, and their vocabulary is the one that stuck. One substance is an activator, which makes more of itself. The other is an inhibitor, which suppresses that self-amplification. Crucially, the inhibitor has to diffuse faster.

Picture what follows. A small excess of activator grows where it stands. The inhibitor it provokes leaks away faster than the activator can follow, so it damps the surroundings rather than the peak. The peak survives, fenced in, and no second peak can form too close. Repeat that across a sheet and the peaks settle at a characteristic spacing, as spots or as stripes.

This is why the pictures look designed although nothing designs them. The spacing comes from the rates, not from any plan, and the same commentary notes how such patterns turn up alike in systems that share nothing else, from pigment on a zebra to ripples in sand.

The Gray-Scott model in words

The model most people simulate today is simpler than Turing’s and comes from chemical engineering. It is due to Gray and Scott, and it became famous through a 1993 paper by John Pearson of Los Alamos. There are two substances, U and V. One V turns a U into another V when two Vs meet a U, so V feeds on U and copies itself. V also decays into an inert product.

Left alone, that reaction would eat all its fuel and stop. So U is topped up continuously at a feed rate, written F, and V is removed at a rate set by a second number, k, called the kill rate here. Both chemicals diffuse, and U diffuses faster than V.

Those 2 numbers, feed and kill, are the whole control panel. Everything else in a typical run is fixed: the diffusion constants, the grid, the time step. Pearson started every experiment the same way, with the dish in its quiet state of all U and no V, and one small patch in the middle disturbed.

The quiet state is stable for every F and k, so nothing happens without a push. Once pushed, part of the F and k plane produces a zoo. He catalogued 12 patterns and labelled them with Greek letters: restless spirals, stripes, regular hexagons, and spots that grow to a critical size and then divide in two. Some classes never settle. In one, spots multiply until they crowd each other, whole neighbourhoods die back to the quiet state together, and the survivors on the rim refill the hole. Pearson measured how fast two nearly identical runs drift apart and found the growth exponential: chaos, from two ingredients.

The useful mental picture is a map with kill along one axis and feed along the other. Most of that map is dull. A scan made with the simulator on this page, kill from 0.042 to 0.070 and feed from 0.008 to 0.072, tried 255 pairs from the same seeded dots. Only 75 of 255 still held a pattern after 6,000 steps. The rest had filled in solid or faded to nothing, and the survivors lay in a curved band between the two.

Here is a walk you can reproduce. Choose feed 0.04 and kill 0.0655, the Mitosis preset, on a grid of 256, and start from seeded dots. Each dot swells, pinches and splits: 38 patches become 117 spots after 3,000 steps and 241 after 6,000. Now move to feed 0.06 and kill 0.062, the Coral preset. Within 3,000 more steps the spots stretch, fuse and branch into about two dozen pieces, nearly all of them long winding arms.

The change between those two points is small: kill drops by 0.0035 and feed rises by 0.02. That sensitivity is the lesson of the map. Near the band, a nudge too slight to notice on a slider decides whether you get dots, worms or a blank square, which is why a pointer you can drag is a better instrument than a pair of number boxes.

Why the steps must be small

A simulation replaces the smooth sheet with a grid and the flow of time with steps. Pearson advanced his grid by the simplest possible rule, forward Euler. At each step every cell compares itself with its neighbours, moves a little toward their average, and then reacts.

That simplest rule has a hard limit. If the time step is too long for the grid, a cell overshoots its neighbours’ average, the next step overshoots back further, and a checkerboard of errors grows until the numbers overflow. For the plain diffusion equation the scheme is stable only when the step is at most the spacing squared over twice the diffusion constant in one dimension, and over four times it in two.

Put numbers in. With cells one unit apart and a diffusion constant of 0.2 for the faster chemical, as the presets here use, the two-dimensional limit is a step of 1.25. The step taken is 1, so a run sits at 1 of 1.25, eighty percent of the way to instability. And because the limit goes with the square of the spacing, a grid twice as fine needs steps four times shorter.

So bigger strides are not on offer. The honest way to go faster is to take more small steps each second, which is the job a graphics chip does well.

What nature does, and what remains unproven

For decades the idea had no experiment behind it. Stationary Turing patterns were first reported in a real chemical system in 1990, in a gel fed with reagents from both sides. Four years later, laboratory experiments on a different reaction showed spots that replicate and then die of overcrowding, the behaviour that numerical simulation had revealed the year before.

Biology has been slower and more contested. A 2010 review in Science says the model’s real-world relevance was long debated, and that compelling examples have gradually eased the skepticism. One of the first came from an angelfish whose stripes are not fixed: as the fish grows, the stripes keep rearranging to hold their spacing, and a simulation based on a Turing system predicted the changes.

Stronger cases identify the molecules. In mouse skin, WNT and its inhibitor DKK were shown to set the spacing of hair follicles, and changing their levels changed the pattern as a model predicted. Shells are a different sort of evidence. The markings on some mollusc shells can be reproduced by activator and inhibitor schemes as frozen traces of waves that travelled along the growing rim. That is a resemblance between a model and a finished object, not an identification of the chemicals.

The zebrafish shows why the distinction matters. Its stripes do satisfy the rule of short-range activation and long-range inhibition. Yet a review of that work reports that the pattern is set by pigment cells that migrate, multiply and touch each other through long protrusions, not by changing concentrations of two diffusing chemicals. The classical model, its authors say, cannot be used as it is.

Theory adds its own warning. A recent mathematical study shows simple systems that pass Turing’s test for instability and still produce only passing patterns that fade. A picture that looks like a simulation is not thereby explained by it, and a model that can start a pattern is not thereby able to keep one.

Using the textures

None of that uncertainty touches the craft use. A Gray-Scott field computed with periodic boundaries wraps around: the right edge continues into the left, so the picture tiles without a seam. Because the field is a smooth quantity and not just a picture, it can also be written as a height map, where 16-bit grayscale keeps the gradations, or as a normal map for lighting.

A normal map stores a direction in each pixel as red, green and blue, and programs disagree about which way green points; the glTF specification, for one, defines its mapping exactly. The simulation cannot tell you which convention your renderer wants. It can only be honest about the one it wrote.

Sources

Every source consulted for this guide. Links checked October 6, 2026.

  1. The chemical basis of morphogenesis A. M. Turing, Philosophical Transactions of the Royal Society of London B 237, 37-72 (1952)
  2. Complex Patterns in a Simple System John E. Pearson, arXiv
  3. Forging patterns and making waves from biology to geology: a commentary on Turing (1952) 'The chemical basis of morphogenesis' Philip Ball, Philosophical Transactions of the Royal Society B (PubMed Central)
  4. Studies of Turing pattern formation in zebrafish skin S. Kondo, M. Watanabe and S. Miyazawa, Philosophical Transactions of the Royal Society A (PubMed Central)
  5. Turing Instabilities are Not Enough to Ensure Pattern Formation A. L. Krause and others, Bulletin of Mathematical Biology (PubMed Central)
  6. Reaction-diffusion model as a framework for understanding biological pattern formation S. Kondo and T. Miura, Science (PubMed record)
  7. A reaction-diffusion wave on the skin of the marine angelfish Pomacanthus S. Kondo and R. Asai, Nature
  8. Experimental observation of self-replicating spots in a reaction-diffusion system K. J. Lee, W. D. McCormick, J. E. Pearson and H. L. Swinney, Nature
  9. WNT and DKK determine hair follicle spacing through a reaction-diffusion mechanism S. Sick and others, Science (PubMed record)
  10. FTCS scheme Wikipedia
  11. glTF 2.0 Specification The Khronos Group
  12. PNG (Portable Network Graphics) Specification Version 1.0 RFC 2083, RFC Editor