Claude Code 新技能逐笔绘制图像
AI 总结
创作者 jchapuis 发布开源 drawing-skill,可将参考图转换为逐笔书写的坐标,再由无头 tldraw 画布渲染,全程不使用图像模型。工作流会分阶段比较渲染结果与原图,并让第二个 Claude 实例描述画面;创作者称,绘制单个对象约需 35万至45万 token,完整场景可能消耗数百万 token。
深度见解
该项目展示了 Claude Code 通过坐标生成和迭代视觉检查绘制图像的路径,与使用专用图像模型的方法不同。
This is drawing, a Claude Code skill. You put a picture in a folder as subject.png and ask Claude to draw it. No image model is involved. Claude types every stroke as coordinates in a Python script, and a headless tldraw canvas renders them. The video replays the ~350 strokes it typed for this house, in order.
It works the way a drawing class teaches: a few loose lines first, then straight lines to get the proportions right, then colour, ink, and a finish (watercolour here). After each stage it compares its render with the subject before going on. One of the checks is a second Claude that never sees the subject and only describes what the drawing shows. If that description doesn't match the subject's, it's back to work.
How Claude helped build it: I built the skill with Claude Code as well. I ran it on subject after subject (a rooster, a dog, a portrait, a bicycle, this house), and each time a drawing went wrong, we turned the failure into a rule or a check. Keeping it honest took the longest. Left alone, Claude will happily write a loop or trace the photo and call that a drawing. So the pen now refuses any script whose strokes come from a loop, another file or mostly computed numbers. Every point is typed out.
Caveats:
It's free and open source (MIT). Install: /plugin marketplace add jchapuis/drawing-skill /plugin install drawing@drawing-skill
Repo, gallery and how it works: https://github.com/jchapuis/drawing-skill
Feedback welcome, maybe you find this experiment interesting. submitted by /u/jchapuis
[link] [comments] |