Aseprite 风格像素画工作室:AI 像人类一样分步绘制精灵,支持选区、图层、动画帧、渐变、对称、参考层与 rgb16 4096 色,每一步实时渲染为 ANSI 终端帧。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:KongChengZhi/dsh-pixel-studio#path:/dsh-cli-anything-aseprite
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Aseprite pixel-art studio for DeepSeek Harness (DSH).
An agent-usable CLI harness for the Aseprite pixel-art editor, built with the CLI-Anything methodology, plus a DSH plugin that turns it into 18 model tools. The AI draws pixel art like a human — one deliberate stroke at a time — and every stroke is rendered live as an ANSI terminal frame, so humans can watch the AI work in real time.
DSH 像素画工作室:AI 像人类一样分步绘制像素画(打形→底色→阴影→高光),
每一步操作实时渲染到终端,人类全程可见。
✨ Features
- Human drawing vocabulary: pixel / line (Bresenham) / rect / ellipse / flood fill / eraser — plus symmetry (h/v/both), tiled mode (seamless textures), gradient (rgb16 interpolation).
- Selection (Aseprite semantics): fill / stroke / clear / copy (persistent clipboard) / paste / move / get.
- Layers: add / remove / duplicate / merge / opacity / visibility / reference layers (rotoscoping, excluded from render).
- Animation: frames, durations, frame tags, onion-skin ghost rendering in the terminal.
- Canvas: free size 1..1024², presets (icon…max), resize with 9-grid anchor, nearest-neighbor rescale.
- Colors: classic palettes (pico8/db16/sweetie16/na16) + rgb16:r,g,b 4096-color mode (16×16×16 indexed RGB).
- Export: PNG (nearest upscale) / animated GIF / sprite sheet PNG+JSON / PNG sequence / native .aseprite binary (hand-written ASE writer, opens in the real Aseprite).
- Undo/redo across CLI processes (sidecar persistence), crash-safe concurrent saves.
- 73/73 tests (unit + E2E, including byte-level .aseprite format checks).
- Optional live monitor UI (draggable overlay: ANSI canvas, preview zoom,
layers with opacity sliders, export buttons, project switcher, workdir
picker) — loaded as a DSH dynamic plugin, see
monitor/.
📦 Install
1. Install the Python harness
pip install -e ./python # provides the `cli-anything-aseprite` CLI
Requires Python ≥ 3.10, click, Pillow. No Aseprite binary needed — the
harness implements the document model, drawing primitives, and the native
.aseprite file format itself. If a real aseprite binary exists, set
ASEPRITE_BIN to enable advanced batch conversion.
2. Install the DSH plugin
From a checkout:
dsh plugin add ./dsh-cli-anything-aseprite
From npm (once published):
dsh plugin add dsh-cli-anything-aseprite
From GitHub:
dsh plugin add github:YOUR_USER/dsh-cli-anything-aseprite
Then verify the layer applied:
dsh --dump-config | grep cli-anything-aseprite
The plugin registers 18 pixelart_* tools in every session of that profile.
Workdir defaults to ~/.dsh/aseprite-work (override with the plugin config: workdir: row or ASEPRITE_WORKDIR env).
🚀 Quick start (AI draws a sprite)
- Open a DSH session (profile with this bundle installed).
- Ask: "画一个 32×32 的像素勇者,pico8 调色板" — or drive the tools manually:
pixelart_new {name: "hero", preset: "sprite", palette: "pico8"} pixelart_draw {op: "line", x: 9, y: 7, x1: 9, y1: 13, color: "#1d2b53"} pixelart_draw {op: "rect", x: 10, y: 7, w: 12, h: 7, color: "#1d2b53"} pixelart_draw {op: "rect", x: 10, y: 7, w: 12, h: 4, color: "#ff004d", fill: true} pixelart_terminal {} # → live ANSI frame (human-watchable) pixelart_export {format: "png", scale: 8} pixelart_export {format: "aseprite"} # → hero.aseprite, opens in Aseprite - Watch the terminal frame after every stroke — the AI's canvas is always visible.
🗂️ Project layout
dsh-cli-anything-aseprite/
├── src/index.js # DSH Host plugin: 18 pixelart_* tools (defineTool)
├── cordis.patch.yml # DSH bundle patch layer
├── package.json # dsh.bundle manifest
├── python/ # cli-anything-aseprite Python harness
│ └── cli_anything/aseprite/
│ ├── core/ # model, canvas (drawing+symmetry+tiled+gradient),
│ │ # palette, layers, animation, export (.aseprite
│ │ # binary writer), session (undo)
│ ├── utils/ # terminal (ANSI frames + onion skin), io, backend
│ ├── tests/ # TEST.md plan + 73 tests
│ └── skills/SKILL.md # AI pixel-art methodology (human drawing passes)
└── monitor/ # optional live GUI monitor (dynamic DSH plugin)
🧪 Test
python3 -m pytest python/cli_anything/aseprite/tests/ -q # 73 passing
🏗️ How it works (architecture)
model tools (pixelart_*) DSH Host plugin (src/index.js)
│ JSON args
▼
cli-anything-aseprite --file X.pxa --json <cmd> Python harness (python/)
│
├── core/canvas.py drawing primitives → sparse cel model
├── core/export.py PNG/GIF/sheet/PNG-seq + .aseprite binary writer
└── utils/terminal.py ANSI truecolor half-block frames (human view)
State persists per project as <name>.pxa (JSON document) + sidecars
(.history.json undo stack, .clipboard.json selection clipboard,
.modes.json symmetry/tiled) — so undo, clipboard and modes survive separate
CLI processes, exactly like a real editor session.
Every mutating tool refreshes the in-memory state and returns version, which
drives the live monitor UI (polling pix-state).
📚 References
- Aseprite CLI docs · New Sprite dialog
- CLI-Anything (HKUDS)
- DSH plugin packaging:
docs/user/develop/basic/publish.zh.md(bundle manifests,dsh plugin add, npm/git install)
License
MIT — see LICENSE.
链接
同类插件
PC2005-cloud/dsh-pet#dsh-pet★ 832
DSH Web UI 桌面宠物:25 个透明动画、屏幕漫游、点击反应与拖拽,附可复现的素材生成链。
Nagi-ovo/dsh-ads★ 636
2005 年中文站点风格的整活广告插件:侧栏广告/信息流/角落弹窗 + 假关闭叉,素材全虚构。
vlln/whale-girl★ 338
桌面宠物(QQ 宠物形态):右下角悬浮、可拖拽/投喂/玩耍。
a86582751/dsh-nexttavern★ 119
面向 DeepSeek Harness 的角色扮演工作台:人物卡可以导入(SillyTavern/TauriTavern),也可以从零交互式写出一张;长篇 TXT 能改编成可玩的角色卡,精读或粗颗粒度两种读法;主代理按剧情主动查阅世界书,正文在独立的酒馆阅读 TAB 中呈现;同一对话里探索多条世界线(重新生成、改后发送、显式分支);带作用域的文风预设(16 种自带文风)、角色 Agent 集群、独立决策卡,以及角色卡或小说导出;长篇由固定设定前缀、硬切上下文窗口、可追溯导演笔记与关键词/语义/混合检索撑住,嵌入可用在线服务,也可完全本地运行。面向 Harness 0.1.2-alpha.3,安装需按文档应用显式兼容补丁。
yyh-001/dsh-meme★ 112
聊天表情包:纯文本斗图、情绪主动发图、像 QQ/微信 一样发图、AI 自动学图、自定义表情包。
Sutera-Diffusus/dsh-whale-musume★ 89
元气鲸鱼娘桌宠:摸头养成、按工具类型联动的工作状态、494 条台词、30 项成就、成长日记、拖拽惯性、主题适配与无障碍模式。关键词感知与余额关心默认关闭、需手动开启;可选的天气心情只在你填了城市后才会请求 Open-Meteo。无遥测。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。