ink-abstraction
Installation
SKILL.md
Ink abstraction
One engine (assets/engine.js, no libraries) turns a subject description into the whole sheet. You never write stage code; you describe the thing. examples/bull.html and examples/hotdog.html are complete subjects; assets/bull.png and assets/hotdog.png show the output.
Workflow
- Copy:
mkdir <dest> && cp ~/.claude/skills/ink-abstraction/assets/engine.js ~/.claude/skills/ink-abstraction/template/index.html <dest>/. Replace thedefineSheet({...})block. - Silhouette first. Sketch the subject in the unit box x 0..200, y 8..120, side view, facing left, filling most of the box. Write
polysas closed point lists, one per part (body, head, legs, bun…); the silhouette is their union. 30–50 points for an organic outline. Helpers like acapsule()orellipse()generator in the subject file are fine. Thin parts (legs, stalks) need ≥ 6 units of width or they vanish in the cell stages. - Shade field.
shade(x, y) → 0..1decides everything tonal: hatch density in I–II, the black mass in III–IV (darkthreshold, default .55), and which mark fills each cell (light → dots, circles, x's, tallies, hatching, scribble ← dark). Build it from a vertical gradient + a few Gaussian bumps (a * Math.exp(-dist² / spread)) for dark and light areas, plus a small sine term for variation. Give distinct parts distinct values so the cells show the structure. - Details.
strokesare open lines drawn with the outline in I–IV (horns, tail, mustard, motion ticks); addknock: 3..5to lay paper under a line so it reads over dark hatching.details(pen, stage, R)draws last in I–IV for faces and small features:pen.dot(x, y, r, 'paper')knocks out a disc,pen.dot(x, y, r)inks one,pen.stroke(pts, {w, amp, knock, close}). Radii are in unit coords. - Anchor.
anchor: [x, y]is the one feature that survives to XII as a hatched knot (a head, a face). Pick the thing that identifies the subject.anchorSwirl: falsedrops the eye swirl drawn there in I–IV. - Look at it — you can't judge this from code:
~/.claude/skills/ink-abstraction/scripts/shot.sh <dest>/index.html /tmp/sheet.pngthen read the PNG. Check: the silhouette reads in I at thumbnail size; III's black mass sits on the dark parts, not everywhere (raisedarkif it floods); VI–VIII show the parts as different marks; XII still suggests the proportions and has the knot in a sensible spot. Tryseed1–3 (third arg) before tuning numbers. - Tell the user: click = new variation, B toggles the boil,
?still,?seed=N.