Brushwork
The direction of the strokes comes from the structure tensor of the paint's tones, smoothed so it follows the run of the strokes and the form rather than the weave. Lines are evenly spaced streamlines, closer where darker; each digit is its spot's value, in the nearest of the eight colours, darkest lines drawn first.
Palette
Eight colours found by clustering the painted areas of a photograph of the painting, the bare paper left out, sorted dark to light. The photograph was taken under warm light, so the palette leans ochre.
Reading
BLIP image captioning, large, with beam search over five beams from “a painting of”. My one correction replaces its last word; the alternatives are its probabilities at each step of the corrected sentence. The other readings are plain temperature sampling, 8 at each temperature.
Looking
Cross-attention from the step that wrote each word to the 24 by 24 patches, times its positive gradient with respect to that word's log probability, averaged over the 12 heads and 12 layers of the text decoder.
Why a white shirt
The same captioner, from the same first words. The bare paper, the mask the shirt is drawn in, filled flat in one colour with the painted parts and my sketched lines left as they are; the head cropped above it; or a flat gray picture. The odds of each word come from one pass over “a painting of a man in a”, and the readings from the same beam search as above.
Numbers
CLIP's byte-pair encoding replayed from its merge table of 48,894 merges: start from letters and join the pair it learned earliest until none applies. The IDs are the ones the image model received.
Draft
Stable Diffusion XL inpainting 0.1 at about one megapixel, 29 Euler steps at strength 0.99, guidance 7, two seeds; the step previews use the tiny SDXL autoencoder. A spot counts as settled at the step after which the guess stays within 4% of its final value.
The numbers in the film
The painting becomes characters the way an ASCII render does (three.js has one built in), but each character is a number: its spot's value from 0 to 9, stretched across the painting's own range, in the nearest of its eight colours, larger and heavier where darker. It turns over a patch at a time, row by row, the order the vision encoder lines its 576 patches up. The bare paper stays open for the shirt.
Digits
A grid of cells over the open paper, every other row shifted half a cell. Paper-light stays empty, darker gets a heavier digit, and each digit lands at the step its spot settled.
On the laptop
Everything ran on a MacBook Pro with an M1 Pro, through PyTorch on the Apple GPU, with open models from Hugging Face. The painting never left the laptop.