What the painters were given

claude-paint

README.md · 157 lines · README

Given to 15 painters:

claude-paint

A physical oil-paint simulator in Rust. Paintings are programs; there is no image model and no reference imagery.

The rule: work only from what is known about each painter (materials, working method, habits of hand, recurring motifs), never from pictures. Existing works may be studied as exercises, but the goal is new paintings in each painter's manner, not copies of old ones.

The second rule: first principles. Every mark is made the way a painter makes it: bristle brushes carrying wet paint over a primed linen surface, paint that levels and dries, layers composited by Kubelka–Munk optics. No flat fills, no optical blends pretending to be paint.

The third rule: tools give physics and constraints, not answers. The engine is the world a painter works in; the painter agents do the seeing, composing and painting, the way a person would (piles mixed on a palette, gestures, time, looking). Read notes/principles.md before designing a tool or writing a brief.

cargo paint friedrich_moonrise_valley               # 1000px preview → out/<name>.png
cargo paint friedrich_moonrise_valley -- --full     # 3200px         → out/<name>_full.png
cargo paint <name> -- --width 1600 --seed 7 --out path.png
cargo paint <name> -- --full --crop 280,440,460,580 # just that window (units) at 3200px
                                                    #   → out/<name>_full_crop.png (--margin 40)
cargo paint <name> -- --ckpt                        # checkpoint after every stage
cargo paint <name> -- --resume mist                 # start from the "mist" checkpoint
cargo paint <name> -- --stop sky                    # save right after a stage ("far_range" = "far range")
cargo paint <name> -- --resume mist --stale-ok --ckpt  # use a stale checkpoint and adopt it
cargo paint <name> -- --no-cracks
cargo test -p paint                                 # UPDATE_GOLDEN=1 to re-record the golden scene

The fast loop for detail work: render the passage you're working on with --full --crop, add --ckpt once, then iterate on the late stages with --resume <stage>. The moonrise figures at full resolution on a busy machine: 86–145 s for the whole canvas, 14 s cropped, 1.6 s cropped and resumed from "mist". Paintings are written in stages (if o.stage("sky", &mut c, &mut rng) { ... }, see paintings/src/run.rs). A crop closely matches the same region of a whole render; a resume is exact. A checkpoint goes stale when the code up to the end of its stage's block changes (setup written after the block, for later stages, doesn't count; tag a line // ckpt: from <stage> when it has to sit higher). Details and limits: notes/workflow.md.

Engine (crates/paint):

Motifs written as gestures and the Run/Finish helpers live in paintings/src.

Canvas coordinates are units: always 1000 wide, 1000 / aspect tall; the physical size in mm comes from the style.

Two frames: c.frame() is the whole canvas. Build every mask and Form on it (painting with a mask of any other size panics). c.window() is the pixels the canvas actually holds, which is the whole canvas or a --crop window. Masks and Forms stay whole-canvas in a crop, so stroke planning and randomness match a whole render. The cost is that their memory and build time scale with the canvas, not the crop. A 3200px Form costs ≈190 MB to keep and ≈310 MB at peak (3:2); build one per motif and drop it after painting (notes/form.md, Memory).

A handling that means to cover (coverage ≥ 1.5, a loaded brush) looks at its passage afterwards and dabs paint into the gaps its strokes left (Handling::fill, notes/surface.md); .fill(false) lets the ground show between strokes.

Handlings mixed from a palette aim at the look on the canvas by default (Aim::Laid), judged over what is already there, as the mean look of the brush's marks (Palette::aim_for). Glazes (Style::glaze) and fixed paints use the paint's masstone instead (notes/color.md).

Notes for the painter (read before writing a painting):

Viewing renders

Canvas texture makes PNGs compress badly (1–20 MB), which floods an [local account redacted]'s context when read as an image. View through scripts/peek, which writes a ≤1000px JPEG (~100–250 KB), optionally cropping first:

scripts/peek out/foo_full.png $TMPDIR/foo.jpg            # whole image
scripts/peek out/foo_full.png $TMPDIR/crop.jpg 700 1000 300 1700   # H W offsetY offsetX
Source