why a bench
Digital media are usually built one at a time, each with its own idea of what a stroke is. That makes them hard to compare: is this watercolour darker than that one because of the paper, the pigment, the speed of the hand, or the way the program stores numbers? The bench puts eleven media behind one stroke format, so the same input can go into each, and it asks every medium for a receipt: what changed on the sheet, where, by how much, and how long it took to come to rest.
The second reason is drawing. A separate project, the Hands library, learns how particular artists draw (the marks they use and how they place them) from public-domain sheets in museum collections. Through the bench, any of those hands can draw a picture in any medium, and the finished sheet can be measured against the picture. When a drawing comes out wrong, the receipts say whether the hand or the medium is responsible.
a stroke and its receipt
A stroke is a list of points, each with a position on the sheet in pixels, a pressure from 0 to 1, and a time in milliseconds, plus a colour and a size:
{ points: [ { x: 67, y: 218, p: 0.6, t: 0 },
{ x: 76, y: 214, p: 0.6, t: 10.4 }, … ],
color: '#2a4fa0', size: 16 }
Every medium implements the same small interface: begin, move and end for a stroke, settle to wait until wet paint stops moving, dry to force it, and snapshot to read the sheet. Strokes are replayed in real time, because wet media simulate in real time: a slow stroke on wet paper is a different stroke.
The receipt compares the sheet before and after, pixel by pixel in CIELAB, counting a pixel as changed when it moved by at least 2 ΔE (about a just-noticeable difference). The footprint is the area the stroke asked for: its path widened to twice its size. Coverage is the share of the footprint the medium marked; spill is the share of the change that landed outside it; ΔL is the mean change in lightness (negative is darker).
tools/stroke_sheets.mjs, records in runs/stroke-sheets/). Pick a medium to see what it does with them: watercolour's strokes feather and pool at their ends, the oil engine drags blue into the yellow, the pencil's light end catches only the paper's tooth, the ballpoint skips where pressure is light.The same strokes can be run live, here in your browser, with each one's receipt:
eleven media, four engines
The wet media come from three open-source simulators, used as their authors wrote them and wrapped in the bench's interface. The dry media, the brush line, the ballpoint and the relief were written for the bench, after ideas in other open projects (named in each medium's sources; no code was taken from projects without an open licence).
| Medium | Engine | Licence |
|---|---|---|
| Watercolour | Watercolor Playground, Maksim Surguy (its fluid solver from Pavel Dobryakov's WebGL-Fluid-Simulation) | MIT |
| Ink wash | inkwash, Jonathan Whitaker | MIT |
| Oil, acrylic, palette knife | Fluid Paint, David Li | MIT |
| Brush line | written here: dabs after libmypaint and p5.brush; colour mixing by spectral.js or by 16 measured paint tubes (spectra via claude-paint) | MIT; CC0 spectra |
| Pencil, charcoal, soft pastel, pastel stick | written here: the paper's grain gates the mark, so light pressure catches only the tooth | MIT |
| Ballpoint, relief | written here | MIT |
Two of the wet engines have a second, changed copy on the bench, for reasons sections 05 and 06 explain: Watercolour, pinned edges and Ink wash, exact. Each change in a copy is a switch, and with every switch off the copy is the upstream engine, so the two can be compared on the same strokes. The originals stay untouched.
a hand draws through a medium
A hand file holds the marks one artist's sheets taught it (Hokusai's swelling brush contours, Van Gogh's reed-pen dashes) and the engine that places them: it looks at a picture, measures what is still wrong, and lays the mark that helps most, until the next mark stops helping. The bench carries the 24 hands of the Hands library and six more taught here, from Degas pastels and Homer watercolours. Each learned stroke keeps its path, pressure, width and taper; the medium supplies the paper, the tooth and the wet behaviour.
For colour, the hand runs as a colour hand: it reads the picture in CIELAB, gives every stroke an ink from the picture's palette, and keeps its own picture of what it expects the sheet to look like. Two things keep that expectation honest. Each medium is calibrated first: it lays rows of swatches in test inks, and the bench fits how far one layer actually goes toward its ink, so the hand's inks can be corrected for that medium. And every hundred strokes the hand looks at the real sheet and starts again from what is there.






runs/). ΔE is the mean CIELAB difference between the finished sheet and the painting over the picture's area; ΔL is the mean difference in lightness (positive: the sheet is lighter than the painting). These are drawings in a medium, not copies: a hand lays a limited number of its own marks.Not every picture suits every medium: a pen hand fattens in oil, and a dark interior turns to mud in watercolour. Where the hand and the medium suit the picture:


Degas, Woman with a Towel (Met)


Degas, Dancers, Pink and Green (Met)


Homer, Hurricane, Bahamas (Met; held out from the corpus the hand learned from)


Hokusai, Lady Holding a Cat (Freer Gallery of Art)


Ingres, Self-Portrait, 1822 (National Gallery of Art)


Degas, Portrait of Hortense Valpinçon, 1883 (Met)


Van Gogh, Fountain in the Garden of Saint-Paul Hospital, 1889 (Van Gogh Museum)
runs/showcase/, runs/showcase2/, runs/pinned-final/ and runs/wet-check/). The drawings in charcoal, pencil, brush line and ballpoint use the hand's own ink; the others are colour hands choosing from the picture's palette.the GPU that rounds down
The wet engines keep their state in floating-point textures on the GPU: pigment, water and the water's velocity, rewritten by shaders every frame. To save memory they store pigment and water as half floats, 16-bit numbers with about three significant digits. Between 8 and 16, for example, a half float can only hold multiples of 1/128.
When a shader writes a value a half float cannot hold, the GPU has to round it. On the machine this bench was built on (an Apple M1 Max, in Chrome, which draws WebGL through Metal), it rounds toward zero: 10.006 is stored as 10.0, not as the nearer 10.0078. One write loses very little. But a wet wash is rewritten every frame as the water moves it, and every rewrite rounds down again, so pigment drains away while the paper is wet. At 3.0, a value that gains 0.001 per frame never moves at all.
Measured on the bench, from the last stroke until the paper was dry (the engines' own textures, summed):
| Engine | Test | half float | 32-bit |
|---|---|---|---|
| inkwash | six pen lines | −24.8% | −0.2% |
| inkwash | six pen lines, then a water wash over them | −51.3% | −8.5% |
| Watercolor Playground | one swatch (copy with only the storage switched) | −31.4% | +0.6% |
Both changed copies store pigment and water as 32-bit floats where the browser allows it. In the watercolour, the loss had also been eating the soft fringe of every wash; with it gone, what sharpens a wash's edge turned out to be a different change, the pinned wet front (a wash on dry paper stops at its own boundary). The loss is reported upstream: watercolor-playground#6, inkwash#2.
the pen that reads the sheet's shape
Ink wash drawings came out far too dark: Hokusai's hand on the Cézanne read ΔE 34.7, with the sheet 26.7 L* darker than the painting. The hand's own log showed why: every hundred strokes darkened the sheet 2.5 to 3.4 times as much as the hand expected, and a glaze cannot be taken back.
The cause was in how the pen measures its own speed. Each frame it takes the distance it moved, in texture coordinates that run 0 to 1 across the sheet and 0 to 1 down it. On a sheet wider than it is tall, a unit across is longer than a unit down, but the pen treats them the same, while its radius is measured in sheet heights. So a stroke drawn across a landscape sheet reads as slower than the same stroke drawn down it, and a slow pen pools ink and lays a darker line. The bench's calibration swatches are horizontal strokes on a sheet more than twice as wide as it is tall; the drawings are on a sheet one and a half times as wide. The calibration was reading lighter marks than the hand would lay.
const dist = Math.hypot(dx, dy); // upstream
const dist = Math.hypot(dx * canvas.width / canvas.height, dy); // the fix
With the fix, the calibration chose a quarter of the ink strength it had chosen before, and the drawings came out at ΔE 17.7 on the Cézanne and 18.7 on Gauguin's Vision after the Sermon (three seeds each), against 34.1 and 33.6 for the engine as upstream: as close as the watercolour, and 3 to 4 L* darker than the paintings instead of more than 20.
does the medium care how fast you draw?
The calibration draws its swatches slowly (0.18 px/ms); the hands draw about seven times faster (1.2 px/ms). If a medium lays a different mark at the two speeds, it is calibrated on marks unlike the ones it will be given.
Across every medium, the amount laid at the hands' speed against the calibration's:
| Medium | 1.2 ÷ 0.18 px/ms | Reading |
|---|---|---|
| Pencil, charcoal, pastels, ballpoint, brush line | 0.98 – 1.21 | speed makes little difference |
| Watercolour, both | 0.90 – 0.92 | little difference |
| Ink wash | 3.36 | the pen pools when slow and lays a full line when fast; Ink wash, exact now calibrates at the hands' speed |
| Oil, acrylic | 0.54 – 0.55 | a faster stroke leaves less paint from the bristles |
| Palette knife | 0.78 |
Oil and acrylic looked like the next case, since their drawings run 7 to 13 L* lighter than the paintings. Calibrating them at the hands' speed changed the drawings by 0.34 ΔE or less. Their receipts said why: the sheet matched what the hand expected to within ΔE 1.7, so the lightness was in what the hand laid, not in how the paint responded. The hand was still darkening when its budget of 1,200 strokes ran out; at 3,000 strokes oil went from ΔE 18.7 to 16.5 and acrylic from 16.7 to 14.8, and there it levels off.
where it stops
- The palette knife is the oil engine with a broad, heavily loaded brush. It reads as a loaded smear, not a blade; a knife needs its own model.
- Pen hands in oil fatten: the oil engine's smallest brush is wider than a pen line.
- Ink wash character. Measured against ink drawings by Goya, Hugo, Hokusai, Kyōsai and Tiepolo (statistics of tone, line direction and colour at eight scales, compared with each artist's own sheets), ink wash drawings sit 1.7 to 3.8 from the artists' own sheets, where the sheets themselves sit 0.70 to 0.87 from each other at the median: too much broad, soft tone and too little fine line. The fixes in sections 05 and 06 put the colour right and left this where it was. The pinned watercolour, on the same scale, reads 0.86 to 2.1.
- One machine. The half-float measurements are from one Apple M1 Max in two Chromium builds. Figure 5 will say what yours does.
Every number on this page, with the runs behind it and the dead ends, is in the lab notes.
made by
Russell Parrish. More info: Parallax Metrology at www.parallaxmetrology.com
It stands on other people's open work: Maksim Surguy's Watercolor Playground, Jonathan Whitaker's inkwash (whose own explainer is the model for this page), David Li's Fluid Paint, Ronald van Wijnen's spectral.js, and the paint measurements gathered in claude-paint. The pictures are public-domain works from the Metropolitan Museum of Art, the Art Institute of Chicago and the Cleveland Museum of Art.