Type a name. Get a graphite doodle. Same name, same face.
A seeded face generator drawn entirely in the browser. Type any username and you get a unique hand-drawn face: a wobbly skull, solid ink hair, tired eyes, and the occasional eye patch or visor. Same name always produces the same face.
No AI. No image assets. Just canvas, TypeScript, and a seeded random number generator.
→ Try it live: doodlefaces.site
Mannay once said "you can just draw faces with javascript" and shared sketchbook after sketchbook of faces that were pure code. This is an independent, clean-room take on that technique: features are painter functions, assembled onto a rough 3D skull, roughed up with a graphite stroke engine.
What makes it fun
- A name is a seed. Share
?u=adaand everyone sees the same ada. - Mix two people with
?u=ada&with=bob: a blended face that inherits traits from both, shareable as anada × bobcard. - Crowd view renders a 5×3 sheet; click any cell and that person changes.
- Every face comes with a trait caption (
gaunt · round · none · seam).
| Mode | What it does |
|---|---|
| Portrait | One graphite head from a username (?u=name) |
| Mix | A blended face from two names (?u=a&with=b) |
| Crowd | A 5×3 sheet of faces from one seed (?view=crowd) |
| Share | Web Share API with a 1200×630 PNG card, or a copyable link |
| Save | Download the card or the crowd sheet as PNG |
- Seeded RNG — mulberry32 + FNV-1a hash. Deterministic, no network.
- 3D skull pinning — features live on a rough head and follow yaw/pitch instead of sliding around in 2D.
- Graphite engine — ribbon strokes with variable width, dry granulation, paper grain, and muted color washes. Everything is drawn, nothing is loaded.
- Dynamic OG —
/api/og?u=namerenders the real graphite face server-side (@napi-rs/canvas, node runtime, bundled Andale Mono font for Linux) for social previews. Same name, same face, same card.
pnpm i
pnpm dev
pnpm test # determinism + src/_lib syncpnpm build # typecheck + vite build into dist/
pnpm dlx vercel --prod # Vercel (with the dynamic /api/og endpoint)
# or
npx wrangler deploy # Cloudflare Workers (static assets only)Static output lives in dist/; the app itself is 100% client-side and
identical on either host. The two deploy targets differ only in the OG
endpoint:
- Vercel (
vercel.json) — installs with pnpm, publishesdist/, and runsapi/og.tsas a Node function (@napi-rs/canvas, runtime "nodejs") for a per-username dynamic social card. - Cloudflare Workers (
wrangler.jsonc) — static assets only (assets.directory: dist, SPA fallback toindex.html);@napi-rs/canvasis a native N-API addon and cannot run in the Workers V8 isolate, soapi/og.tsis not deployed here. Social previews fall back to the staticpublic/og.png.public/_headerscarries the security headers thatvercel.json'sheadersblock sets on Vercel.
api/
og.ts dynamic social card per username (serverless)
public/
og.png static fallback, icons, robots.txt, sitemap.xml
src/
types.ts Face DNA
rng.ts mulberry32 + FNV hash
geom.ts 3D projection, pin-to-skull, path smoothing
ink.ts graphite stroke, paper, grain, washes
face.ts seed → traits
draw.ts painters, share card, crowd sheet
main.ts desk UI + i18n-ready strings
MIT — do whatever you want. A credit link back is always appreciated.