pixelcanvas
pixelcanvas is a command-line paint program your AI agent drives. Give it a reference picture and the agent redraws it
like a painter: it plans the regions, then works stage by stage (sketch, line, flat colour, shade, detail, finish).
After every command pixelcanvas reports what changed in numbers and writes a picture of the result; the agent opens it,
judges it, and goes on or undoes. Ask for a redraw with changes (mint-green hair, a poster, a lake behind the
figure), or describe a picture in words.

繁體中文
pixelcanvas ships as one Python package with one command, pixelcanvas, and its Agent Skill,
skills/pixelcanvas/SKILL.md.
It runs in Claude Code, opencode or any agent with a shell and a way to open image files, with hosted models and
with small local ones. numpy, Pillow, OpenCV, scikit-image and SciPy; no image model, no GPU, no network.
Results
On a private set of 93 reference pictures (anime, landscape, promotional art), the redraw path reaches a judge
mean of 9.42 out of 10, and the judge rates 88 of the 93 redraws the same quality as the reference. In the redraw
path the strokes follow the reference and take their colours from it along the stroke, and no picture is retouched
pixel by pixel. A small open-weight model (Qwen 3.8 Flash class) driving the skill in Claude Code or opencode
finishes a redraw in about 19-45 minutes and 44-86 commands; its sessions now cover 23 anime pictures, with a judge
mean of 9.52 and 21 of 23 rated the same quality as the reference (the scripted path on the same pictures: 9.48,
22 of 23).
Install
pip install pixelcanvas # the pixelcanvas command
pixelcanvas install-skill # the skill -> ~/.claude/skills/pixelcanvas
pixelcanvas install-skill --opencode # or -> ~/.config/opencode/skills/pixelcanvas
Then ask your agent: "Redraw reference.jpg with pixelcanvas", "Redraw reference.jpg as a minimalist poster" or
"Paint a mountain lake at sunset".
More ways (Claude Code plugin, npx skills, a clone): docs/INSTALL.md.
How it works
The picture lives in a project folder, pic.pixelcanvas/: the reference, one PNG per layer, the regions, the undo
history and a journal of every command. Each command changes it and prints a report: the scores
before -> after, warnings, the worst spots, a VIEW: picture of the canvas, a VIEW-REF: picture of the
reference over the same area, and a NEXT: line with the command to run next.
The agent works in a loop: one command, read the report, open VIEW, say in one sentence whether it helped,
then follow NEXT: or pixelcanvas undo. Coordinates are 0-1000 on each axis, read off the rulers in the views.
Every stage paints on its own layer and has a gate that pixelcanvas measures per region. pixelcanvas stage done moves on
only when the gate passes, or when the agent gives a reason (--because "..."). pixelcanvas todo --all prints the
whole work list; the agent copies it into its own todo tool and ticks off each line.
Three modes
| mode | start | who makes the marks |
|---|
| trace | pixelcanvas new pic --ref reference.jpg --mode trace | the stage commands follow the reference and take their colours from it; the agent plans regions, orders the work, checks each command and decides where to refine |
| hand | pixelcanvas new pic --ref reference.jpg --mode hand | the agent, mark by mark, with the reference beside it (experimental) |
| free | pixelcanvas new pic --mode free --request "..." | the agent, with construction tools, from a text request; it plans subjects and their parts, then goes through the same stages |
A redraw, command by command
The trace-mode session the skill teaches, for an anime picture with dark outlines (style cel). One command per
shell call, and a look at VIEW after each: