The other point of interest is that this program produces the various sub-types of patterns seen on real giraffe subspecies, all with the same mechanism, by changing one or two values such as how much of the substrate molecule is present at the beginning, or how much product must be present in order for a cell to produce pigment. The difference between Reticulated and Masai giraffes (and all the others) is not the result of any extra or missing processes. It even produces the fuzzy edging and little "failed border" inlets found on real giraffe patterns, not because of a special addition to the program but because that's a natural consequence of this algorithm. (Those inlets, as you will find, are a result of two blotches that merged early on.)
After several years of occasionally working with cellular automata and various pattern-making algorithms, I had a 'eureka' moment one day and realized this specific set of rules should make giraffe spots. Part of the nature of cellular automata is that the patterns they generate are emergent (not directly written into the rules, but rather emerge/coalesce, much like weather) so it can be extremely difficult to predict a result just by knowing all of the components of the algorithm. Imagining it isn't enough, so I had to program it and make sure it actually worked. My efforts to find such a program already on the internet were always unsuccessful, so I put this on the web in case someone else might someday find it interesting, whether they are into giraffes, or programming, or whatever else.
This method is different from other diffusion-reaction systems in a few key ways. First, the substrate (normally called U) does not replenish. The amount at the start is all that is ever used to complete the process. The spots are able to run right up to each others' edges without overlapping, because the substrate (via diffusion) gets sucked up into the expanding blotches before they arrive. In the blue/yellow display (uncheck the giraffe colors and cell states boxes) you can see this as the dark regions around the expanding blotches that look like shadows. Second, the product (normally called V) stays in the cell where it is made and does not diffuse. Although there is an option to allow it, so that you can see the consequence, it is off by default. This also allows the edges of the blotches to stay separated. Third, at the start only a few cells start out in the "on" state, which makes them capable of performing the chemical reaction. All other cells are switched "off" at the beginning. The "on" cells then slowly activate their neighbors, switching them to the "on" state after a while. This also allows the substrate to be sucked up into the blotches as they expand, again helping to create the border regions between blotches. Finally, the threshold can be used by cells to determine whether they do or do not produce pigment. Increasing the threshold will "erode" the pattern and widen the borders.
One final note on producing patterns, the borders stay rather slim if thresholds are not used. Setting a high threshold will widen the borders, but will also erode the weaker parts of the blotches. To solve this problem, after the process has covered the whole image and you've paused it, run a few cycles of "smooth" and observe the changes until the pattern looks correct for the type you are trying to produce. (This would correspond to the product molecule being released from cells and allowed to diffuse through the tissues after the process has completed.) The other way to do this is by setting the B Diffusion Rate to a very low number like 0.01, but this has a side-effect: the edges that meet early are smoother than the edges that are filled out at the very end. Either way is biologically possible. I do not have detailed enough pictures of giraffe skins to know for certain which of the two above results would be a better match to real giraffes, but it appears the latter may be more realistic.
This simulation requires each virtual cell to be able to produce, convert, and detect the levels of a few molecules, and for these molecules to be able to diffuse throughout the surrounding tissue. Real cells are little chemical factories, they can make enzymes to catalyze a reaction, and detect the presence or concentration levels of specific proteins, and processes can be switched on/off depending on conditions. And of course real molecules that leave the real cells can diffuse throughout the real tissues. Putting all of this together, a cell can 'communicate' and 'interact' with other nearby cells via these processes, thus making this simulation a real possibility.
I enjoy creating and toying with cellular automata as a hobby. One of the challenges I've taken on is trying to produce realistic animal patterns with them, because obviously the skin is an actual CA and these have to be produced by a similar process. I'm working on a more universal model, in an attempt to find a (ha ha) Grand Unified Theory of vertebrate skin patterns, so keep an eye out for that, too.
If you've found this model or this page useful or interesting (especially if it is in any way involved in any real research, biology or computers or math) I'd love to hear about it, so feel free to drop me a note at firstname.lastname@example.org with any comments, ideas, etc.
Note that the pattern changes as it reaches the extremes of the animal. This shows the various amounts of progress of the pattern as it forms, so that you can see the intermediate parts of the process. Notice that also the 'most complete' parts of the pattern tend to be at about the shoulders and radiates out from there (or on some species, along the length of the spine more so than just the shoulders) so that the more 'distant' a point is on the (embryo-shaped) body the less developed the pattern is at that point, with the most distant points being the belly, fingers/toes, tail, and nose. The same can be observed on the rosette patterns of big cats, where the legs only have black spots and the rosettes become more 'complete' as you approach the 'origin' by the spine, such as the picture on the left.
This suggests that the process does not take place simultaneously, but instead begins first at or near the 'neural crest' area (the base of the neck) and then radiates outward from there. One can see this phenomenon in corn snakes known as 'bloodred' where the pattern fades out as one goes from dorsal toward ventral.
Also notice the fact that the left and right halves of the pattern will 'separate' on the tail end of many animals, such as the stripes on zebras. In this example you can see they are connected from right to left in the front half, and then they lose continuity as they approach the rear. This is presumably because the pattern is forming while the left and right halves of the skin are closed over the cranial end of the spine, but are still open on the caudal end of the spine.
This phenomenon also shows up in striped corn snakes, where the longitudinal stripes tend to break into shorter dashes toward the tail.
Also, back to the giraffes, notice the white space between polygons is larger on the neck, which shows that the pattern formed on the skin before it grew from a 'regular embryo' shape into a 'giraffe' (longer neck) shape.
Another type of model for pattern formation (such as the Clonal Mosaic) will use groups of cells which migrate over the skin and then grow, pushing other cells out of the way while doing so. I think this model fails to explain the following phenomenon. Here we see a typical zebra.
Take a look at the yellow stripe(s) and the blue stripes which are highlighted on the left picture. These stripes are another anomaly which can provide clues to the process that produced them, and help us identify whether a model is accurate, because a reaslistic model should not only produce the 'pretty' aspects of a pattern, but also make the same 'mistakes' that the real process makes.
What happens here is that where the blue stripes die out, the yellow stripe expands to takes its place, and additionally, it even splits into two stripes. There's no reason for this to happen with three separate groups of cells that are each just expanding. However, this is precisely the type of thing that happens if you have a cellular automaton that starts at the spine and sweeps toward the belly, where the 'on' cells produce a signal that causes cells to turn off once a certain threshold is reached. (This anomaly occurs with a reaction-diffusion model, or a 'radius-threshold' model as well.)
The trick with the zebra pattern (and others such as the tiger) is the pointy tips on the stripes. A typical cellular automaton like reaction-diffusion produces smooth rounded edges on everything and is typically incapable of making pointy things. Some models offer a 'cheat' by making the cells biased along a certain axis, turning spots into elliptical spots that look stripe-like. But this still fails to produce splitting and merging of stripes, or pointy tips. This is where adding a 'sweep' element to the model can make a difference. Instead of having a simultaneous two-dimensional automaton with all cells being equal, the activity takes place in a line (or regtangle) parallel to the spine. The area of activity then sweeps toward the belly. As it finally tapers off, the activity would then be able to taper to sharp points.
This type of activity is also consistent with the slow fading out of patterns on the legs/belly of many animals. You can see this on the leg of the giraffe below. The picture is turned sideways to fit this page better, but you can see the torso on the left and the leg on the right. Notice the pattern does not just continue in a complete fashion and then stop. It fades in intensity and completeness.