Self-Painting SVG
Pick a picture. It gets traced into flat patches of color, and each patch gets a place on a timeline: a small depth model guesses how far away each patch is, and the paint goes on from the back to the front, sky before hills, hills before the tree in front. The result is a single SVG file that sketches itself in charcoal, paints itself in, holds, then falls apart and starts over. It runs in your browser, and nothing is uploaded. The file plays anywhere an SVG does, with no JavaScript.
Choose a picture
Starry Night
From a web address
Detail low medium high
Loop (s)
Order back to front (depth) edges to the focus big shapes, then a sweep
Focus off a point (click the picture) faces
Focus size
Simplify outside
Shapes traced patches primitives where they fit ellipses rectangles triangles
Fit ≥
Ending falls apart, loops stops when painted
Size small medium large
Paint it
Copy link
Download
Animated .svg
Animated .svgz
Finished picture .svg
Finished picture .svgz
Web Tile .tile
Layers far to near by color Merge Reset
Hover a layer to find it in the picture. Click layers' pictures or names to select them for Merge ; ⤫ splits a merged layer again. The color well shifts every color in the layer together; the box hides it. Downloads keep the changes.
Inspired by svjeez by Sai Ashirwad, which compiles hand-written TSX scenes to animated SVG.
This one starts from a picture instead. The tracer is the in-browser port of
image-to-svg , and
the source and write-up are on GitHub.
The back-to-front order came from running Baidu's Unlimited-SVG , which redraws a picture as SVG layer by layer, sky first and near objects last; a small depth model turned out to predict its order (write-up ).
Depth comes from Depth Anything V2 Small (Apache-2.0), run in the browser by Transformers.js from the onnx-community export.
Faces for the focus are found by Google's MediaPipe face detector (Apache-2.0); the focus maps follow image-to-wgsl 's foveation.
Shapes are grown by Ward-linkage merging of neighbouring patches; colors shift in Björn Ottosson's OKLab .
The ellipse, rectangle and triangle drawings are in the spirit of Michael Fogleman's primitive , though here each patch gets the shape that matches its own size and slant rather than shapes found by search.
The .tile download is a Web Tile , a format from DASL ; the page writes it the way their @dasl/tile-writer does.