
Crochet Engine
io.github.dengyu123456由 GitHub 账号 dengyu123456 发布v0.1.1更新于 Oct 24, 2026
Deterministic photo-to-crochet-chart engine: stitch counts, 5 techniques, yarn estimates.
概览
将照片或 ASCII 设计转换为钩针编织图,提供精确针数、技法预设和毛线用量估算。
- 可以做什么
- 这是一个通过 stdio 暴露的确定性照片转钩针编织图引擎。工具包括 photo_to_chart(本地图片路径转为编织图 PNG 及每色针数)、render_ascii_design(ASCII 设计文件转为编织图 PNG 和针数)以及 estimate_yarn_tool(根据针数估算某一毛线粗细或全部的每色码数)。支持五种技法预设(graph、c2c、tapestry、mosaic、filet),采用缩放、中位切分颜色量化和杂色清理,而非 AI 图像生成。
- 适用场景
- 当助手需要把照片或 ASCII 设计转换为可复现针数的钩针编织图,或为编织图估算毛线码数时使用。适合重视精确、可重复输出而非生成式图像的编织图案规划。
- 运行要求
- 作为 Python 包(crochetpatterngen-engine)通过 stdio 在本地运行;可用 pip 安装,可选 mcp 附加项,或通过 uvx 运行。需要 Python 及 Pillow、numpy;背景移除需要可选的 rembg 附加项。未声明账户、API 密钥或环境变量。仅限桌面端。
安装
在 SourceWeft 中
- 打开 控制台中的 Crochet Engine,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
crochetpatterngen-engine
The deterministic photo-to-crochet-chart engine behind crochetpatterngen.com — packaged as a Python library, CLI, and MCP server so AI agents (Claude Desktop, Cursor, etc.) can turn photos into crochet charts with exact stitch counts.
Deterministic, not generative. There is no AI image generation here — just resize, median-cut color quantization, and confetti cleanup. Same input, same chart, same stitch counts, every time. No hallucinated rows.
Why this engine
- Real stitch counts — every chart comes with per-color hex + stitch counts that sum exactly to the grid size. What you see is what you crochet.
- C2C block aspect correction — C2C blocks are physically wider than tall (0.7:1 h:w). The engine adjusts grid dimensions so the worked piece keeps the photo's proportions instead of coming out squashed.
- 5 technique presets —
graph,c2c,tapestry,mosaic,filet. - Yarn estimation — per-color yardage for 6 yarn weights (fingering → super bulky).
- Zero heavy deps — Pillow + numpy only. Optional
rembgextra for background removal.
Install
Python API
CLI
MCP server (Claude Desktop & friends)
Add to claude_desktop_config.json:
Or with a regular pip install:
Tools exposed (stdio transport):
ASCII design format
See designs/frog.txt and designs/dragon.txt:
One character per stitch; . is the background/padding color. Rows are padded to the longest row.
Development
License
MIT — see LICENSE.
Free web tool + pattern library at crochetpatterngen.com.
来源:README.md,提交 31b75ce
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分