Skip to content

Commands

m4bwav edited this page Nov 14, 2026 · 2 revisions

All commands run as python scripts/fw.py <command> from the repository root. Outputs below come from a run on 2026-11-14 on Windows with Python 3.14.6 and NumPy 2.5.2, with FW_COMFY_HOSTS="" so no GPU was used. Every command that draws something writes a recipe JSON next to the picture.

This page covers stills, measuring and identifying. The rest:

doctor

python fw.py doctor
python      3.14.6                                   required (3.9+)
numpy       2.5.2                                    core: render, measure (pure Python fallback for small renders)
Pillow      12.3.0                                   optional: measure on image files (PNG writing is built in)
moderngl    missing                                  optional accelerator: float64 GLSL stills (not wired yet)
browser     msedge                                   for the playwright route
3d          browser route only                       fw.py 3d needs the playwright route above; no NumPy fallback for 3D

The Playwright line names the browser and GPU it found, and the ffmpeg line gives its path; both are left out above. ffmpeg is needed by every video command and by audio.

explain

python fw.py explain mandelbrot
mandelbrot
  formula: z <- z^2 + c, z0 = 0, c = pixel
  how: Escape time: iterate each pixel's c until |z| > R or max_iter. Points that never escape form the set (area ~1.50659). Smooth colour mu = n + 1 - log(log|z|)/log 2 with R >= 256.
  presets: mandelbrot-full, seahorse
  more: references/02-escape-time.md#mandelbrot

render

Takes a preset name or a recipe JSON. Options: -o, --size WxH, --iter, --palette, --supersample, and for the Kronecker family --mask and --power.

Presets: mandelbrot-full, seahorse, julia-dendrite, julia-rabbit, burning-ship-full, burning-ship-armada, tricorn-full, multibrot-3, kronecker-carpet, kronecker-vicsek, kronecker-cantor-dust.

python fw.py render kronecker-carpet -o carpet.png
wrote carpet.png and carpet.json

Deep zoom: past a view width of about 1e-12, or with --deep, Mandelbrot and quadratic Julia recipes render by perturbation (a high-precision reference orbit, float64 deltas, rebasing). A view at width 1e-20:

python fw.py render deep.json -o deep.png --size 160x90 --deep
deep: rebased 14400 pixels
wrote deep.png and deep.json

Other families stop at float64's limit, about 1e-13, rather than render noise.

palette

python fw.py palette
classic  cosine
fire     cosine
ocean    cosine
ultra    stops
grey     stops
python fw.py palette fire -o fire.png
wrote fire.png

sheet

A labelled contact sheet over palettes, or over one parameter with --vary params.max_iter --values 100,300,1000 (complex values as re:im). It also writes a JSON with each tile's recipe.

python fw.py sheet julia-rabbit --palettes classic,fire,ocean -o sheet.png --tile 120x68
wrote sheet.png (3 tiles) and sheet.json

measure

Subcommands: box, lacunarity, profile, katz, heightmap, ifs, area. Add --json for machine output.

Box-counting dimension of the carpet rendered above (true value log 8 / log 3 = 1.8928):

python fw.py measure box carpet.png
measure: box-dimension
dimension: 1.8114
r2: 0.9997
curvature: 0.0222
fit_px: [2, 182]
decades: 1.9590
sizes: [2, 3, 4, 5, 7, 9, 12, 16, 22, 30, 40, 55, 74, 100, 135, 182]
counts: [82680.000, 39706.500, 23378.250, 15429.625, 8290.375, 5094.500, 3017.125, 1781.500, 993.625, 561.875, 333.500, 189.250, 109.750, 69.625, 40.250, 24.750]
local_slopes: [1.837, 1.866, 1.868, 1.859, 1.847, 1.831, 1.831, 1.818, 1.812, 1.749, 1.726, 1.694]
slope_spread: 0.1745
offsets: 8
seed: 0
specks_removed: 0
image: [729, 729]
verdict: descriptor only: fit range 1.96 decades is under 2
warnings: ['coarse boxes bias D; read the local-slope curve, not one number']
image_file: carpet.png

The verdict line matters more than the number: under two decades of fit the result is a descriptor, not a measurement. Why this one reads low is in the FAQ.

Similarity dimension from scale ratios (Sierpinski triangle):

python fw.py measure ifs --ratios 0.5,0.5,0.5
measure: similarity-dimension
ratios: [0.500, 0.500, 0.500]
dimension: 1.5850
note: exact only when the pieces do not overlap (open set condition); with overlap it is an upper bound

Area of the Mandelbrot set:

python fw.py measure area --size 512
measure: mandelbrot-area
size: 512
max_iter: 10000
area: 1.5071
reference: 1.5066
error: 0.0005

identify

Takes a preset, recipe, image, or --c re,im for a Julia parameter. It reports hand-built features and never names a fractal from its dimension.

python fw.py identify julia-dendrite
identify: v1
features: {'family': 'escape-time', 'formula': 'julia', 'julia_connected': True}
hints: ['connected Julia set: the orbit of 0 stays bounded, so c is in the Mandelbrot set']
python fw.py identify --c -0.12,0.75
identify: v1
features: {'family': 'escape-time', 'formula': 'julia', 'julia_connected': True}
hints: ['connected Julia set: the orbit of 0 stays bounded, so c is in the Mandelbrot set']

Clone this wiki locally