This algorithm is a specific instance of a more general matrix overlay method commonly used in image processing.
This method works by superimposing a pattern over each pixel of the original image, performing some math on the pixels under the pattern, and storing the result in a new image.
The pattern for this algorithm is shown at the right (where "C" indicates the current pixel).
All pixels marked with a "*" are summed, the result divided by 4 (a mathematical average), a constant value is subtracted (to dim the flame), and the result stored in the original pixel location.
A benefit of this method is that everything can be done in-place in the original image (this is not true in general since other pixels may depend on the original value of the current pixel).
To compute the next generation, this pattern is applied to the current generation from left-to-right, top-to-bottom, and the new image drawn.
|
+---+---+---+
| | C | |
+---+---+---+
| * | * | * |
+---+---+---+
| | * | |
+---+---+---+
|