Files
photocraft/crates
UnemarsandClaude Fable 5.1 7deeaeeba1 Brush: large tips rasterize, accumulate and composite in parallel
A 2000 px soft tip is a 12 MP dab, and every dab ran on one thread: the tip's
coverage (92 ms), its accumulation into the stroke's tiles (44 ms) and the
composite of the dirty tiles into the layer (177 ms), about 300 ms a dab, so a
stroke across a 24 MP photo lagged by a quarter second per frame. Photoshop
keeps such strokes fluid by spreading them over the cores.

Each stage is independent per row (the round tip's coverage) or per tile (the
accumulation, the composite), so they now run on the thread pool from 256²
pixels of work up, to the same pixels: the per-pixel maths is untouched, the
dither and Dissolve hash positions, and a test renders a 700 px soft stroke,
a Dissolve stroke and a per-dab-colour stroke (with a selection, 8-bit) both
ways and compares every pixel. Below the threshold, and on the web, nothing
changes. The composite's writes to the layer stay in order; its tiles are
composited in batches so the pending regions stay small.

`examples/big_dab_bench.rs` prints the stages of one dab. On a loaded 16-thread
machine the 12 MP dab went from about 300 ms to 100–140 ms; the hard 2000 px
tip from 75 to 35 ms.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 01:16:29 +02:00
..
…
…