Fractal Flame

A fractal flame generator in Python: the Chaos Game (IFS) algorithm, multiprocess rendering that merges the workers’ histograms, gamma correction and rotational symmetry.

Period
November 2025 — June 2026
Status
Completed
My role
Sole developer: the algorithm, parallel rendering, CLI and configuration.
Aurora — an example of a generated fractal flame

An implementation of the fractal flame algorithm: a large number of points are run through a set of affine and non-linear transforms following the Chaos Game (IFS) scheme and accumulated in a density histogram, which then goes through a logarithmic transform and, after it, gamma correction.

Rendering runs in one process or several, and the parallel results merge into a single histogram. The worker count affects speed. Each worker also follows its own sequence of random points, so frames built with different process counts can differ in small details.

Stack

  • Python
  • NumPy
  • multiprocessing

Key technical decisions

  • Rendering is split across processes, and the workers’ histograms are merged into one.
  • Gamma correction after the logarithmic density transform: without it the image comes out flat.
  • Rotational symmetry as a separate parameter of the composition.
  • Parameters come from the CLI and a JSON config, so any frame can be rebuilt from the one it was made with.
  • Strict typing checked by mypy, unit and integration tests, linting and CI.

What gamma correction buys

Point density is heavily skewed: without gamma correction almost everything lands in the dark tones and the structure disappears. The correction brings out detail in the low-density regions without blowing out the dense ones. Here is the same frame with it and without:

Gamma correction off
Gamma correction off
Gamma correction on
Gamma correction on

Every example on this page has a config behind it. They all live in the repository, and the two frames above differ by a single value in them.

Media