Chawk

Every squiggle is a function.

An image goes in. Chawk traces the ink, splits it into strokes, and fits lines, arcs, waves, and splines. The drawing comes back as a plot.

Run locally
$ docker run --rm -p 8010:8000 \ ghcr.io/hello2himel/chawk:latest

↑ the cat is just algebra. even the shades too!

x(t) = 1107.77 − 10.11cos 2πt − 13.83sin 2πt + 0.79cos 4πt − 8.73sin 4πt x(t) = 731.41 − 0.5cos 2πt − 10.89sin 2πt + 0.44cos 4πt − 1.69sin 4πt x(t) = 793.35 − 20.89cos 2πt − 7.79sin 2πt + 2.1cos 4πt − 1.52sin 4πt x(t) = 810.64 + 0.64cos 2πt + 3.18sin 2πt + 0.09cos 4πt − 0.13sin 4πt …and 1,668 more

Five images. Rebuilt from equations.

Each proof is the rebuilt render. Open one to compare the source with the equations-only reconstruction.

← click a proof to drag the compare handle

From ink to equations.

Chawk reads the drawing with a deterministic computer-vision pipeline, then fits primitives to the ink.

Original flat-colour illustration of a cat in sunglasses against a blue sky

The image goes in.

A flat-shaded illustration or a photo of line art. The tracer finds the ink itself.

Blue edge trace of the cat illustration on paper

The ink becomes strokes.

An adaptive mask isolates ink from paper. Contours are split at corners, resampled, and fitted: line, circle, ellipse, sinusoid, spline. The cat gets 1,672 equations.

The cat illustration rebuilt from 1,672 equations

The proof comes out.

Every layer is rendered from the fitted functions. The equations are the artifact.

the model is just a very patient curve fit.

How it works: an ink mask, contour extraction, corner splitting, resampling, primitive fitting, model selection, then a Matplotlib render. Every step is deterministic.

The cat is algebra.

The pixel-shades cat is 1,672 equations. Every region boundary is a fitted function, rendered from its coefficients.

1,672equations
24colours
4shown here
Read the pipeline
PROOF 01 / PIXEL-SHADES CAT1,672 EQ
x(t) = 1107.77 − 10.11cos 2πt − 13.83sin 2πt + 0.79cos 4πt − 8.73sin 4πt x(t) = 731.41 − 0.5cos 2πt − 10.89sin 2πt + 0.44cos 4πt − 1.69sin 4πt x(t) = 793.35 − 20.89cos 2πt − 7.79sin 2πt + 2.1cos 4πt − 1.52sin 4πt x(t) = 810.64 + 0.64cos 2πt + 3.18sin 2πt + 0.09cos 4πt − 0.13sin 4πt …and 1,668 more
4 of 1,672 showneven the shades are curves

Your machine. Your doodle.

The showcase is precomputed. The tracer runs locally in one Docker container, on your machine.

Run Chawk locally
$ docker run --rm -p 8010:8000 \
    ghcr.io/hello2himel/chawk:latest
Open localhost:8010 Quick start