Show HN: Autoportrait- Painting Timelapses in JavaScript Autoportrait, a new JavaScript library, renders any image as a deterministic, reproducible painting timelapse on an HTML canvas, simulating graphite underdrawing and watercolor washes entirely client-side without machine learning. The tool, inspired by Nobel portrait artist Niklas Elmehed, offers configurable choreography, automatic segmentation, and exports to GIF, WebM, or self-contained HTML. autoportrait renders an image as a timed painting performance on an HTML canvas: a graphite underdrawing traced along the image's edge field, then watercolor washes applied region by region in a configurable order. Analysis runs entirely client side, the full stroke plan is computed before the first frame, and a seeded PRNG makes every performance reproducible and seekable. There are no dependencies and no runtime ML. autoportrait does not generate a painting. It generates a deterministic painting performance for an existing image. I love timelapses of painters at work, and I wondered whether the effect could be replicated in software: the underdrawing going down first, the washes pooling, the subject finished before the world behind it. The visual style is inspired by the sketch-then-color announcement portraits Niklas Elmehed paints for the Nobel Prizes https://physicsworld.com/a/meet-the-artist-behind-the-nobel-portraits-how-to-avoid-nobelitus/ . I built the engine for my personal site https://philipweiss.net , where it paints my portrait for each visitor. The animation above plays at the real speed of the default configuration, about 48 seconds. Playground https://philipweiss.net/autoportrait/ · Usage usage · Options options · Choreography choreography · How it works how-it-works Deterministic. A seed reproduces a painting stroke for stroke. seek t rebuilds the canvas at any instant. Automatic segmentation. k-means in CIELAB with spatial weighting, plus heuristic labels face , figure , sky , water , dark , warm that the ordering options understand. Choreography control. Presets, an explicit region order, focus points, or a callback over the full stroke plan. Optional figure mask. With a subject mask, figure and background paint on separate layers and the background can arrive behind a finished subject. A one-command script generates the mask. Events. Caption, progress, and ready callbacks for building UI around the performance. philipweiss.net/autoportrait https://philipweiss.net/autoportrait/ hosts the playground. Pick a sample painting or upload your own picture, steer the choreography with presets and focus points, scrub the timeline the colored track marks the acts , and export the result as a GIF, a WebM video, or a self-contained HTML page that repaints it. Everything runs in the browser; uploads never leave your machine. npm install autoportrait Or skip the build entirely and import from a CDN; the package is plain ES modules: js import { paint } from "https://cdn.jsdelivr.net/npm/autoportrait@0.1/src/index.js"; js