dotomata 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dotomata-0.1.1/.claude-plugin/marketplace.json +14 -0
- dotomata-0.1.1/.claude-plugin/plugin.json +21 -0
- dotomata-0.1.1/.github/workflows/publish.yml +18 -0
- dotomata-0.1.1/.gitignore +14 -0
- dotomata-0.1.1/LICENSE +21 -0
- dotomata-0.1.1/PKG-INFO +134 -0
- dotomata-0.1.1/README.md +109 -0
- dotomata-0.1.1/agents/sprite-artist.md +85 -0
- dotomata-0.1.1/docs/card-art.md +101 -0
- dotomata-0.1.1/docs/config.md +211 -0
- dotomata-0.1.1/docs/sprites.md +531 -0
- dotomata-0.1.1/pyproject.toml +45 -0
- dotomata-0.1.1/skills/card-art/SKILL.md +58 -0
- dotomata-0.1.1/skills/sprite/SKILL.md +93 -0
- dotomata-0.1.1/src/dotomata/__init__.py +1 -0
- dotomata-0.1.1/src/dotomata/__main__.py +5 -0
- dotomata-0.1.1/src/dotomata/art.py +575 -0
- dotomata-0.1.1/src/dotomata/artcli.py +143 -0
- dotomata-0.1.1/src/dotomata/assemble.py +234 -0
- dotomata-0.1.1/src/dotomata/background.py +184 -0
- dotomata-0.1.1/src/dotomata/build.py +216 -0
- dotomata-0.1.1/src/dotomata/checks.py +52 -0
- dotomata-0.1.1/src/dotomata/cli.py +535 -0
- dotomata-0.1.1/src/dotomata/codexrun.py +430 -0
- dotomata-0.1.1/src/dotomata/common.py +215 -0
- dotomata-0.1.1/src/dotomata/convert.py +265 -0
- dotomata-0.1.1/src/dotomata/default_config.json +372 -0
- dotomata-0.1.1/src/dotomata/fixes.py +82 -0
- dotomata-0.1.1/src/dotomata/generate.py +328 -0
- dotomata-0.1.1/src/dotomata/imaging.py +98 -0
- dotomata-0.1.1/src/dotomata/parts.py +210 -0
- dotomata-0.1.1/src/dotomata/reduce.py +76 -0
- dotomata-0.1.1/src/dotomata/refadopt.py +121 -0
- dotomata-0.1.1/src/dotomata/selftest.py +1299 -0
- dotomata-0.1.1/src/dotomata/selftest_art.py +488 -0
- dotomata-0.1.1/src/dotomata/selftest_data/exec_events_json_item.jsonl +6 -0
- dotomata-0.1.1/src/dotomata/selftest_data/exec_events_rollout.jsonl +5 -0
- dotomata-0.1.1/src/dotomata/selftest_data/fake_codex.py +122 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_mask.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_motion.json +62 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_preview.gif +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_report.json +56 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_sheet.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/beast/silhouette_beast_zoom.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_mask.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_motion.json +62 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_preview.gif +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_report.json +56 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_sheet.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/boss/silhouette_boss_zoom.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_mask.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_motion.json +62 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_preview.gif +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_report.json +56 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_sheet.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/humanoid/silhouette_humanoid_zoom.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_mask.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_motion.json +62 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_preview.gif +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_report.json +56 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_sheet.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/output/Silhouettes/slime/silhouette_slime_zoom.png +0 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/down.txt +18 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/grid.txt +52 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/palette.json +5 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/parts.json +20 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/parts_mask.txt +52 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/beast/unit.json +11 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/down.txt +31 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/grid.txt +112 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/palette.json +5 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/parts.json +20 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/parts_mask.txt +112 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/boss/unit.json +11 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/down.txt +23 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/grid.txt +80 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/palette.json +5 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/parts.json +20 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/parts_mask.txt +80 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/humanoid/unit.json +11 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/down.txt +12 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/grid.txt +40 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/palette.json +5 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/parts.json +20 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/parts_mask.txt +40 -0
- dotomata-0.1.1/src/dotomata/selftest_data/golden/source/Silhouettes/slime/unit.json +11 -0
- dotomata-0.1.1/src/dotomata/selftest_data/rollout_extension_two_calls.jsonl +11 -0
- dotomata-0.1.1/src/dotomata/selftest_data/rollout_two_calls.jsonl +6 -0
- dotomata-0.1.1/src/dotomata/selftest_provenance.py +156 -0
- dotomata-0.1.1/src/dotomata/selftest_refadopt.py +156 -0
- dotomata-0.1.1/src/dotomata/selftest_rigs.py +218 -0
- dotomata-0.1.1/uv.lock +54 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dotomata",
|
|
3
|
+
"description": "dotomata: a pixel sprite, card art and background pipeline for Claude Code.",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "zeikar"
|
|
6
|
+
},
|
|
7
|
+
"plugins": [
|
|
8
|
+
{
|
|
9
|
+
"name": "dotomata",
|
|
10
|
+
"source": "./",
|
|
11
|
+
"description": "Agent pipeline that turns a character from concept art into a validated, game-ready animated pixel sprite sheet; also card art and backgrounds, generated through the Codex CLI."
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dotomata",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Agent pipeline that turns a character from concept art into a validated, game-ready animated pixel sprite sheet; also card art and backgrounds, generated through the Codex CLI.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "zeikar"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/zeikar/dotomata",
|
|
9
|
+
"repository": "https://github.com/zeikar/dotomata",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pixel-art",
|
|
13
|
+
"sprite",
|
|
14
|
+
"sprite-sheet",
|
|
15
|
+
"animation",
|
|
16
|
+
"gamedev",
|
|
17
|
+
"card-art",
|
|
18
|
+
"image-generation",
|
|
19
|
+
"codex"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # PyPI trusted publishing; no token is stored
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v6
|
|
16
|
+
- run: uv run dotomata selftest
|
|
17
|
+
- run: uv build
|
|
18
|
+
- run: uv publish
|
dotomata-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zeikar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
dotomata-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dotomata
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: AI pixel art sprite generator: concept art to a validated, animated, game-ready sprite sheet
|
|
5
|
+
Project-URL: Homepage, https://github.com/zeikar/dotomata
|
|
6
|
+
Project-URL: Documentation, https://github.com/zeikar/dotomata/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/zeikar/dotomata/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/zeikar/dotomata/releases
|
|
9
|
+
Author: zeikar
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,claude code,codex,game assets,gamedev,image generation,pixel art,sprite,sprite generator,sprite sheet
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Games/Entertainment
|
|
20
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
21
|
+
Requires-Python: ==3.12.*
|
|
22
|
+
Requires-Dist: numpy==2.5.4
|
|
23
|
+
Requires-Dist: pillow==12.3.0
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# dotomata
|
|
27
|
+
|
|
28
|
+
**AI pixel art sprite generator for 2D games.** dotomata (*dot + automata*) is an agent pipeline that takes a character from concept art to a validated, game-ready animated pixel sprite sheet: idle, attack, hit, guard and down animations, a sprite sheet PNG and a motion JSON any engine can read. It runs as a Claude Code plugin or a Python CLI, with image generation through the Codex CLI.
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## What makes it different
|
|
35
|
+
|
|
36
|
+
- **Every build is checked.** A sheet is written only if the figure is the target height, its feet sit on the foot row in every standing frame, it stays within the palette cap, it has no semi-transparent pixels, nothing touches the cell border, and every required action has its exact frame count.
|
|
37
|
+
- **Reproducible rebuilds.** Every output is rebuilt from committed sources (the generated image, the grid, the hand-fix list, the part data). Outputs carry no dates, paths or tool versions, and the dependencies are pinned, so the same sources give the same pixels. `dotomata verify` rebuilds everything and compares it with what is on disk.
|
|
38
|
+
- **Provenance for every generated image.** Each run records its prompt, references, model, generation count and the image's sha256. The image is read from the run's own Codex session, never from a file the model saved, and a duplicate of any recorded image is refused.
|
|
39
|
+
- **Human checkpoints.** The person adopts the candidate and approves the final animation. Every decision is recorded with its reason. The plugin starts each segment only once the previous checkpoint is on file, and the CLI refuses to record checkpoint 2 or 3 before the one before it is approved. Generation has a hard cap per character.
|
|
40
|
+
- **Rigged motions, not generated frames.** The image model draws one standing pose. Parts (head, torso, arms, legs, weapon, shield...) are split on a shared rig, and motion templates move them by whole pixels, so every frame stays on the same grid and palette, and a new character reuses every animation.
|
|
41
|
+
|
|
42
|
+
## How it works
|
|
43
|
+
|
|
44
|
+
1. **Concept art** (optional): a card illustration of the character, which the sprite is then drawn from.
|
|
45
|
+
2. **Base pose**: the Codex CLI draws one standing pose on magenta. A size pass shrinks the chosen design to the target height in code and has the model clean it up on that grid.
|
|
46
|
+
3. **Pixel grid and palette**: the background is keyed out, the model's pixel grid is found and colours are reduced to a small palette.
|
|
47
|
+
4. **Hand fixes**: cell-level edits in a list (from an agent, or painted by you), counted per category.
|
|
48
|
+
5. **Parts and rig**: each cell is assigned to a part; joints, hidden cells and alternative drawings are added.
|
|
49
|
+
6. **Motions**: idle, attack, hit, guard and down are assembled from templates.
|
|
50
|
+
7. **Output**: sheet, mask, motion JSON and previews, after every check passes.
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- [uv](https://docs.astral.sh/uv/). It installs the pinned Python 3.12, Pillow and numpy on first run.
|
|
55
|
+
- The [Codex CLI](https://github.com/openai/codex), logged in, with image generation available. Image generation in Codex needs a ChatGPT plan that includes it. Only the generate commands use Codex; converting, building and verifying work without it.
|
|
56
|
+
|
|
57
|
+
## Install as a Claude Code plugin
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
/plugin marketplace add zeikar/dotomata
|
|
61
|
+
/plugin install dotomata@dotomata
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The plugin adds two skills and an agent:
|
|
65
|
+
|
|
66
|
+
- `/dotomata:sprite <unit>`: makes an animated sprite through three segments, stopping for you to adopt a candidate and to approve the final GIF.
|
|
67
|
+
- `/dotomata:card-art <unit>` or `/dotomata:card-art backgrounds/<id>`: card art (2:3 portrait and bust) or a 16:9 background, from one batch you pick from.
|
|
68
|
+
- `sprite-artist`: the agent the sprite skill dispatches for each segment.
|
|
69
|
+
|
|
70
|
+
The skills check the prerequisites on first use and offer to create `dotomata.json` in your project.
|
|
71
|
+
|
|
72
|
+
## Use the CLI without Claude Code
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
uvx dotomata --help # run without installing
|
|
76
|
+
uv tool install dotomata # or install it (pipx: pipx install --python 3.12 dotomata)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
dotomata pins its Python, Pillow and numpy versions exactly so rebuilds stay identical, so install it as a tool in its own environment rather than into a project's environment. Or clone the repository and run it from your project root:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
git clone https://github.com/zeikar/dotomata
|
|
83
|
+
uv run --project /path/to/dotomata dotomata --help
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Every path in the config is relative to the directory you run it from (or `--root`).
|
|
87
|
+
|
|
88
|
+
## Quick start
|
|
89
|
+
|
|
90
|
+
In your project (`dotomata` stands for either command above):
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
dotomata init # writes dotomata.json and sprites/.gitignore
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Describe a character in `sprites/source/knight/unit.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"id": "knight",
|
|
101
|
+
"kind": "humanoid",
|
|
102
|
+
"name": "Knight",
|
|
103
|
+
"colors": ["#3f5a8c", "#c9cdd4", "#8c2f2f"],
|
|
104
|
+
"equipment": ["shield", "weapon"],
|
|
105
|
+
"design": "A stocky young knight with short copper hair, a dented steel breastplate over a navy tunic and a red scarf. He carries a round wooden shield with a white star, his signature item, and a short sword.",
|
|
106
|
+
"actions": {"idle": "humanoid_idle", "attack": "shield_bash", "hit": "humanoid_hit", "guard": "guard_raise", "down": "humanoid_down"}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Then, in Claude Code, run `/dotomata:sprite knight`. Without Claude Code, follow [Your first unit](https://github.com/zeikar/dotomata/blob/main/docs/sprites.md#your-first-unit): `generate`, `reduce`, `checkpoint`, `convert`, `fix`, `parts`, `assemble`, `build`, `verify`.
|
|
111
|
+
|
|
112
|
+
## Outputs
|
|
113
|
+
|
|
114
|
+
`dotomata build knight` writes to `build/sprites/knight/` (configurable):
|
|
115
|
+
|
|
116
|
+
| File | Content |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `knight_sheet.png` | Transparent sprite sheet: one row per action, one cell per frame. |
|
|
119
|
+
| `knight_mask.png` | White silhouette of the same layout, for hit flashes and tints. |
|
|
120
|
+
| `knight_motion.json` | Cell size, foot point, and per action the frame positions, frame time and strike frame. |
|
|
121
|
+
| `knight_preview.gif`, `knight_zoom.png` | Previews. |
|
|
122
|
+
| `knight_report.json` | Height, colours, hand-fixed and newly drawn cells, generations used, check results. |
|
|
123
|
+
|
|
124
|
+
The sheet and the motion JSON are all an engine needs; nothing is tied to a particular engine. Card art builds a full portrait and a square bust PNG; a background builds one PNG at the configured size.
|
|
125
|
+
|
|
126
|
+
## Docs
|
|
127
|
+
|
|
128
|
+
- [Sprites](https://github.com/zeikar/dotomata/blob/main/docs/sprites.md): the workflow, file formats, rigs and templates, commands, checks, guardrails and reproduction.
|
|
129
|
+
- [Card art and backgrounds](https://github.com/zeikar/dotomata/blob/main/docs/card-art.md)
|
|
130
|
+
- [Configuration](https://github.com/zeikar/dotomata/blob/main/docs/config.md): every key of `dotomata.json`.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
The code and docs are [MIT](https://github.com/zeikar/dotomata/blob/main/LICENSE). The example art in `docs/images/` shows characters from the author's own game in development and is not covered by the MIT license.
|
dotomata-0.1.1/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# dotomata
|
|
2
|
+
|
|
3
|
+
**AI pixel art sprite generator for 2D games.** dotomata (*dot + automata*) is an agent pipeline that takes a character from concept art to a validated, game-ready animated pixel sprite sheet: idle, attack, hit, guard and down animations, a sprite sheet PNG and a motion JSON any engine can read. It runs as a Claude Code plugin or a Python CLI, with image generation through the Codex CLI.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## What makes it different
|
|
10
|
+
|
|
11
|
+
- **Every build is checked.** A sheet is written only if the figure is the target height, its feet sit on the foot row in every standing frame, it stays within the palette cap, it has no semi-transparent pixels, nothing touches the cell border, and every required action has its exact frame count.
|
|
12
|
+
- **Reproducible rebuilds.** Every output is rebuilt from committed sources (the generated image, the grid, the hand-fix list, the part data). Outputs carry no dates, paths or tool versions, and the dependencies are pinned, so the same sources give the same pixels. `dotomata verify` rebuilds everything and compares it with what is on disk.
|
|
13
|
+
- **Provenance for every generated image.** Each run records its prompt, references, model, generation count and the image's sha256. The image is read from the run's own Codex session, never from a file the model saved, and a duplicate of any recorded image is refused.
|
|
14
|
+
- **Human checkpoints.** The person adopts the candidate and approves the final animation. Every decision is recorded with its reason. The plugin starts each segment only once the previous checkpoint is on file, and the CLI refuses to record checkpoint 2 or 3 before the one before it is approved. Generation has a hard cap per character.
|
|
15
|
+
- **Rigged motions, not generated frames.** The image model draws one standing pose. Parts (head, torso, arms, legs, weapon, shield...) are split on a shared rig, and motion templates move them by whole pixels, so every frame stays on the same grid and palette, and a new character reuses every animation.
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
1. **Concept art** (optional): a card illustration of the character, which the sprite is then drawn from.
|
|
20
|
+
2. **Base pose**: the Codex CLI draws one standing pose on magenta. A size pass shrinks the chosen design to the target height in code and has the model clean it up on that grid.
|
|
21
|
+
3. **Pixel grid and palette**: the background is keyed out, the model's pixel grid is found and colours are reduced to a small palette.
|
|
22
|
+
4. **Hand fixes**: cell-level edits in a list (from an agent, or painted by you), counted per category.
|
|
23
|
+
5. **Parts and rig**: each cell is assigned to a part; joints, hidden cells and alternative drawings are added.
|
|
24
|
+
6. **Motions**: idle, attack, hit, guard and down are assembled from templates.
|
|
25
|
+
7. **Output**: sheet, mask, motion JSON and previews, after every check passes.
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- [uv](https://docs.astral.sh/uv/). It installs the pinned Python 3.12, Pillow and numpy on first run.
|
|
30
|
+
- The [Codex CLI](https://github.com/openai/codex), logged in, with image generation available. Image generation in Codex needs a ChatGPT plan that includes it. Only the generate commands use Codex; converting, building and verifying work without it.
|
|
31
|
+
|
|
32
|
+
## Install as a Claude Code plugin
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/plugin marketplace add zeikar/dotomata
|
|
36
|
+
/plugin install dotomata@dotomata
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The plugin adds two skills and an agent:
|
|
40
|
+
|
|
41
|
+
- `/dotomata:sprite <unit>`: makes an animated sprite through three segments, stopping for you to adopt a candidate and to approve the final GIF.
|
|
42
|
+
- `/dotomata:card-art <unit>` or `/dotomata:card-art backgrounds/<id>`: card art (2:3 portrait and bust) or a 16:9 background, from one batch you pick from.
|
|
43
|
+
- `sprite-artist`: the agent the sprite skill dispatches for each segment.
|
|
44
|
+
|
|
45
|
+
The skills check the prerequisites on first use and offer to create `dotomata.json` in your project.
|
|
46
|
+
|
|
47
|
+
## Use the CLI without Claude Code
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
uvx dotomata --help # run without installing
|
|
51
|
+
uv tool install dotomata # or install it (pipx: pipx install --python 3.12 dotomata)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
dotomata pins its Python, Pillow and numpy versions exactly so rebuilds stay identical, so install it as a tool in its own environment rather than into a project's environment. Or clone the repository and run it from your project root:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
git clone https://github.com/zeikar/dotomata
|
|
58
|
+
uv run --project /path/to/dotomata dotomata --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Every path in the config is relative to the directory you run it from (or `--root`).
|
|
62
|
+
|
|
63
|
+
## Quick start
|
|
64
|
+
|
|
65
|
+
In your project (`dotomata` stands for either command above):
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
dotomata init # writes dotomata.json and sprites/.gitignore
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Describe a character in `sprites/source/knight/unit.json`:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"id": "knight",
|
|
76
|
+
"kind": "humanoid",
|
|
77
|
+
"name": "Knight",
|
|
78
|
+
"colors": ["#3f5a8c", "#c9cdd4", "#8c2f2f"],
|
|
79
|
+
"equipment": ["shield", "weapon"],
|
|
80
|
+
"design": "A stocky young knight with short copper hair, a dented steel breastplate over a navy tunic and a red scarf. He carries a round wooden shield with a white star, his signature item, and a short sword.",
|
|
81
|
+
"actions": {"idle": "humanoid_idle", "attack": "shield_bash", "hit": "humanoid_hit", "guard": "guard_raise", "down": "humanoid_down"}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Then, in Claude Code, run `/dotomata:sprite knight`. Without Claude Code, follow [Your first unit](https://github.com/zeikar/dotomata/blob/main/docs/sprites.md#your-first-unit): `generate`, `reduce`, `checkpoint`, `convert`, `fix`, `parts`, `assemble`, `build`, `verify`.
|
|
86
|
+
|
|
87
|
+
## Outputs
|
|
88
|
+
|
|
89
|
+
`dotomata build knight` writes to `build/sprites/knight/` (configurable):
|
|
90
|
+
|
|
91
|
+
| File | Content |
|
|
92
|
+
|---|---|
|
|
93
|
+
| `knight_sheet.png` | Transparent sprite sheet: one row per action, one cell per frame. |
|
|
94
|
+
| `knight_mask.png` | White silhouette of the same layout, for hit flashes and tints. |
|
|
95
|
+
| `knight_motion.json` | Cell size, foot point, and per action the frame positions, frame time and strike frame. |
|
|
96
|
+
| `knight_preview.gif`, `knight_zoom.png` | Previews. |
|
|
97
|
+
| `knight_report.json` | Height, colours, hand-fixed and newly drawn cells, generations used, check results. |
|
|
98
|
+
|
|
99
|
+
The sheet and the motion JSON are all an engine needs; nothing is tied to a particular engine. Card art builds a full portrait and a square bust PNG; a background builds one PNG at the configured size.
|
|
100
|
+
|
|
101
|
+
## Docs
|
|
102
|
+
|
|
103
|
+
- [Sprites](https://github.com/zeikar/dotomata/blob/main/docs/sprites.md): the workflow, file formats, rigs and templates, commands, checks, guardrails and reproduction.
|
|
104
|
+
- [Card art and backgrounds](https://github.com/zeikar/dotomata/blob/main/docs/card-art.md)
|
|
105
|
+
- [Configuration](https://github.com/zeikar/dotomata/blob/main/docs/config.md): every key of `dotomata.json`.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
The code and docs are [MIT](https://github.com/zeikar/dotomata/blob/main/LICENSE). The example art in `docs/images/` shows characters from the author's own game in development and is not covered by the MIT license.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sprite-artist
|
|
3
|
+
description: Use this agent to run exactly one segment of the dotomata sprite pipeline for one unit, between two checkpoints. Segment 1 writes unit.json if needed and runs either the design pass (one generate call: one base pose candidate, or a batch with per-run variants; from the adopted card art with --from-art when the unit has one) or the size pass (reduce the picked design to the target height, then one generate batch from that reference), checking each candidate's height. Segment 2 converts the adopted candidate and writes the hand-fix list. Segment 3 splits parts and equipment layers, assembles motions, builds and verifies. It is dispatched by the dotomata sprite skill with the CLI invocation, the unit, the segment number and the user's feedback, and returns a short report with the file paths to show the user. It never asks the user anything, never records a checkpoint and never commits.
|
|
4
|
+
model: inherit
|
|
5
|
+
color: orange
|
|
6
|
+
tools: Bash, Read, Write, Edit, Glob, Grep
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You run **one segment for one unit** of the dotomata sprite pipeline. The procedure, file formats and rules are in the `docs/sprites.md` whose path the caller gives you; read it when you start. Config values are in the project's `dotomata.json`.
|
|
10
|
+
|
|
11
|
+
## Input
|
|
12
|
+
|
|
13
|
+
The caller gives you:
|
|
14
|
+
|
|
15
|
+
- the exact command to run the CLI (below: `DOTOMATA`), e.g. `uv run --project /abs/path/to/dotomata dotomata`. Use it exactly as given, from the project root;
|
|
16
|
+
- the project root (absolute) and the docs path;
|
|
17
|
+
- the unit path, the segment number (1, 2 or 3) and, for segment 1, whether it is the design pass or the size pass;
|
|
18
|
+
- the user's words from the last checkpoint (rejection reasons, things to fix), and for a new unit the agreed `unit.json` contents.
|
|
19
|
+
|
|
20
|
+
If the command, the unit or the segment is missing, do nothing and report what is missing. Read `paths` in `dotomata.json`: units live in `<source>/<unit>/`, previews in `<preview>/<unit>/`.
|
|
21
|
+
|
|
22
|
+
## Preconditions
|
|
23
|
+
|
|
24
|
+
- Segment 2 starts only if `DOTOMATA checkpoint <unit> --require 1` succeeds; segment 3 only if `--require 2` succeeds. Otherwise change nothing and report that the previous checkpoint is not recorded.
|
|
25
|
+
- A palette-swap unit (`palette_swap` in `unit.json`) has only segment 3 and requires nothing before it.
|
|
26
|
+
- Do your segment and stop. Never go on to the next one.
|
|
27
|
+
|
|
28
|
+
## Segment 1: candidates
|
|
29
|
+
|
|
30
|
+
Segment 1 has two passes ("Segment 1: design pass and size pass" in the docs). It is the size pass when the caller says so and gives the design candidate picked at checkpoint 1a; otherwise the design pass.
|
|
31
|
+
|
|
32
|
+
1. If `<source>/<unit>/unit.json` does not exist, write it (format: "`unit.json`" in the docs) from what the caller gave you: `id` (the folder name), `kind`, `rig` if not the kind's default (`flyer` for a flying creature), `name`, `colors`, `equipment`, `design`, optional `sprite_note` and `restore_details`, and `actions`:
|
|
33
|
+
- humanoid: `humanoid_idle`, `humanoid_hit`, `humanoid_down`, one big action (`sword_slash`, `shield_bash`, `staff_cast` or `bow_shot`), plus `guard_raise` for a shield unit;
|
|
34
|
+
- slime: `slime_idle`, `slime_attack`, `slime_hit`, `slime_down`;
|
|
35
|
+
- beast and boss: `beast_idle`, `beast_attack`, `beast_hit`, `beast_down`;
|
|
36
|
+
- flyer (`"rig": "flyer"`): `flyer_idle`, `flyer_attack`, `flyer_hit`, `flyer_down`.
|
|
37
|
+
|
|
38
|
+
`design` is English, without a name or any medium-specific words (head count, pixel size go in `sprite_note`), and states what sets this character apart from the user's other characters plus one signature item. No names of existing games, studios or artists. If `unit.json` exists without `actions` (a unit that got its card art first), keep `design` as it is and add only the sprite keys.
|
|
39
|
+
2. After a rejection, pass the reason with `--note`. Use at most one reference image (`generate` refuses several).
|
|
40
|
+
- **Size pass:** first `DOTOMATA reduce <unit> --candidate candidate_N.png` (the 1a pick), with `--height` if the caller gives one. If a `ref_*.png` of that name exists already, reuse it only if its `ref_*.json` `source` is this candidate; otherwise stop and report, and do not `--force` it (earlier generation records point at its sha256). The reduced grid size (width x height) is `grid_size` in `ref_*.json`. Then `generate` with `--batch 3 --design-from-file ref_<H>px_x<block>.png` and the docs' three cleanup sentences as `--variant`s, with `<H>`, `<block>` and `<W>` filled in. Follow a different batch size or variants if the caller gives them.
|
|
41
|
+
- A reference image the caller prepared: copy it into the unit folder as `ref_<name>.png` and use `--design-from-file`.
|
|
42
|
+
- Only when the caller explicitly asks to redraw from one of this unit's earlier candidates: `--design-from candidate_N.png` (it does not hold the size well; size problems go to the size pass).
|
|
43
|
+
- **Design pass with card art:** a unit with adopted card art (`<source>/<unit>/art/art.json`) uses `--from-art` (`--batch 3 --from-art` unless the caller says otherwise). Put the card art's path in your report so the main conversation can compare.
|
|
44
|
+
- **Design pass without card art:** no reference image. The size pass fixes the height, and a scale reference makes a new character copy the reference's face. Use `--reference` only if the caller explicitly asks for a scale reference.
|
|
45
|
+
3. Run `DOTOMATA generate <unit> ...` **once**. With a batch size and variants from the caller, pass `--batch N` (up to `generation.batch_max`) and `--variant "..."` (the i-th goes to run i); without, one image (the size pass default is above). If it is refused (used + N would pass the cap), do not retry: report it.
|
|
46
|
+
4. Read the height check of every candidate:
|
|
47
|
+
- Size pass: a `FAIL` candidate is out. It is already counted and its reason is in `generation.json`. Do not generate again; report it with its measured height. If this size pass gave no passing candidate and an earlier one also failed, add the fallback ("When the size pass keeps failing" in the docs: adopt the existing `ref_*.png` as the source) to your report as an option, with that image's absolute path. Whether to take it is the user's decision; recording it is the main conversation's.
|
|
48
|
+
- Design pass: report `FAIL` candidates as designs too, with their measured height (the size pass fixes size).
|
|
49
|
+
- `REVIEW` is not out: say the measurement includes the held weapon, staff or bow, and that head to foot is judged at checkpoint 1.
|
|
50
|
+
|
|
51
|
+
## Segment 2: convert and hand fixes
|
|
52
|
+
|
|
53
|
+
1. Convert, depending on what is already there:
|
|
54
|
+
- No `convert.json` yet: `DOTOMATA convert <unit>` (the input is the image adopted at checkpoint 1).
|
|
55
|
+
- `convert.json` exists and its `source` is the image adopted at checkpoint 1 (a redo of the hand fixes only): skip convert; keep `grid.txt` and work on `fixes.json`.
|
|
56
|
+
- `convert.json` exists from an earlier adoption and the caller says checkpoint 1 was redone: `DOTOMATA convert <unit> --force`, and start `fixes.json` over as an empty edit list (format in the docs): the old edits point at cells of the old grid.
|
|
57
|
+
- Otherwise stop and report the mismatch.
|
|
58
|
+
|
|
59
|
+
If the user adopted a reduced `ref_*.png` as the fallback, the tool reads it block by block; expect more fixes than usual on the face and small details.
|
|
60
|
+
2. Look at `<preview>/<unit>/convert_zoom.png` and `grid.txt`, and write cell edits into `fixes.json` for the face, weapon, emblems and stray cells, each with a reason and a category from `fix_categories`. Fix any pink edge cells the convert output reports to the outline colour. Never edit `grid.txt`.
|
|
61
|
+
3. `DOTOMATA fix <unit>`, and check the counts per category. If many cells were fixed, report what and why.
|
|
62
|
+
4. If the caller passes an edited PNG from the user (their edit of the transparent `<preview>/<unit>/fixed_edit.png`), add it with `DOTOMATA fix <unit> --from-png <path> --category <category> --reason "<reason>"`. `fixed_zoom.png` has a solid background and cannot be read back.
|
|
63
|
+
|
|
64
|
+
## Segment 3: parts, motions, build
|
|
65
|
+
|
|
66
|
+
1. `DOTOMATA parts <unit> --init` writes the mask skeleton (with `--force` only when the caller says the grid changed since the last mask, i.e. checkpoint 1 was redone; a redo after checkpoint 3 keeps the existing mask and parts). Replace every `?` in `parts_mask.txt` with the rig's symbols (table in the docs). Write the joints in `parts.json`: humanoid `neck`, `shoulder`, `hand`, `hip`, `foot`, with the foot's y on the legs' bottom row; beast only `foot`, on the back legs' bottom row; flyer only `foot`, on the torso's bottom row. `--init` puts the foot on the whole figure's bottom row, so correct it for a beast or a flyer.
|
|
67
|
+
2. Draw the cells a motion reveals in `added` grids, and the fallen pose as `variants.down` (for a flyer, lying on the ground). A flyer also draws `front_wing@up`, `front_wing@down`, `back_wing@up`, `back_wing@down` in `swaps` (the generated pose is mid-beat). A sword unit draws its arm and blade poses as swaps and wires them in with `overrides`. Anything a template gets wrong for this unit goes into its `overrides`; change the shared rigs and templates in `dotomata.json` only when the caller explicitly asks.
|
|
68
|
+
3. `DOTOMATA parts <unit>` and `DOTOMATA assemble <unit>` for previews and checks. Check the draw order and the hidden parts by eye in `<preview>/<unit>/<id>_zoom.png`.
|
|
69
|
+
4. When every check passes: `DOTOMATA build <unit>` (a palette swap: `DOTOMATA palette-swap <unit>`; add `--force` when the caller says this is a rebuild of existing outputs), then `DOTOMATA verify <unit>`. If the unit has `art/dot_ref.png`, the build refreshes it (`refreshed ...`); list it among the changed files.
|
|
70
|
+
|
|
71
|
+
## Never
|
|
72
|
+
|
|
73
|
+
- Ask the user anything. When a decision is needed, put the options and your recommendation in the report and stop.
|
|
74
|
+
- Run `checkpoint --record`. Checkpoints are recorded by the main conversation.
|
|
75
|
+
- Commit, or `git add`.
|
|
76
|
+
- Change the dotomata code. If the tool blocks, report its error message as it is.
|
|
77
|
+
- Overwrite existing candidates or outputs with `--force`, unless the caller explicitly says to rebuild them.
|
|
78
|
+
- Run `generate` more than once in segment 1 (a batch is one run), or `reduce` more than once in the size pass.
|
|
79
|
+
|
|
80
|
+
## Report (short)
|
|
81
|
+
|
|
82
|
+
- What you did and the result, in a line or two.
|
|
83
|
+
- Absolute paths of the files to show: segment 1: each `candidate_N.png`, the comparison sheet `<preview>/<unit>/batch_*.png`, and in a size pass `ref_*.png` with the reduced grid size; segment 2: `<preview>/<unit>/fixed_zoom.png` and `<preview>/<unit>/fixed_edit.png` (the one to edit and hand back); segment 3: `<id>_zoom.png` and `<id>_preview.gif`.
|
|
84
|
+
- Numbers: measured height and target, height check (`PASS`, `REVIEW`, `FAIL`), generations this time and in total, fixed cells per category, newly drawn cells, check results.
|
|
85
|
+
- What to ask the user at the next checkpoint.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Card art and backgrounds
|
|
2
|
+
|
|
3
|
+
dotomata also makes two kinds of painted pictures with the same generation runner as the sprites: **card art** (a 2:3 full-body portrait of a unit, plus a square bust crop) and **backgrounds** (16:9 scenes). They share the sprite pipeline's [generation guardrails](sprites.md#generation-guardrails) (one image per run, batches, variants, banned names, counting, provenance, caps counted per kind), [`verify`](sprites.md#reproduction) and the [command conventions](sprites.md#commands). Config keys are under `art`, `bg` and `comparison_sheet` in [config.md](config.md).
|
|
4
|
+
|
|
5
|
+
The image model's picture is used as is, without hand fixes, so both have a single decision: the person picks one candidate from a comparison sheet. They can generate more within the cap and adopt again; adoptions accumulate and the latest one is used.
|
|
6
|
+
|
|
7
|
+
## Card art
|
|
8
|
+
|
|
9
|
+
Card art belongs to a unit: it lives in `<source>/<unit>/art/` and uses the unit's `design` from `unit.json`. A unit can have card art only (no `actions`), a sprite only, or both. When it has both, the two are tied together:
|
|
10
|
+
|
|
11
|
+
- A unit with adopted card art draws its sprite from it (`generate --from-art`, see [art first](sprites.md#units-with-card-art-art-first)). For a new character, making the card art first is the recommended order.
|
|
12
|
+
- A unit whose sprite is already built sends a picture of that sprite (`dot_ref.png`) with every card art run as a design reference.
|
|
13
|
+
|
|
14
|
+
### Files
|
|
15
|
+
|
|
16
|
+
| Source (`<source>/<unit>/art/`) | Written by | Content |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `art_candidate_<N>.png` | `art adopt` | The adopted candidate only. The others stay in `<preview>/<unit>/art/` and are not committed. |
|
|
19
|
+
| `art_generation.json` | `art generate` | Every candidate's prompt, references, generation count, sha256 and `note`, including discarded ones. `art invalidate` adds `invalid`. |
|
|
20
|
+
| `art_batch_<first>-<last>.jpg` | `art generate` | The batch's comparison sheet (small JPEG, `comparison_sheet`): the record of what was chosen from. |
|
|
21
|
+
| `art.json` | `art adopt`, `art bust` | Adoptions per stage; the last one is used. |
|
|
22
|
+
| `dot_ref.png` | `art dot-ref`, sprite `build` | The built sprite as a design reference. |
|
|
23
|
+
| `recolor.json` | you | Recolour units only (below). |
|
|
24
|
+
|
|
25
|
+
| Output (`<art_output>/<unit id>/`, written by `art build`) | Content |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `<id>_<stage>_full.png` | The full picture: the adopted candidate's pixels as they are (no crop, no resampling). |
|
|
28
|
+
| `<id>_<stage>_bust.png` | The bust: the square from `art.json`, shrunk with LANCZOS to `art.bust_size`. |
|
|
29
|
+
|
|
30
|
+
- Both PNGs are RGB with fixed compression and no metadata. Generated images carry the generator's metadata chunks, so the full picture is written from the pixels rather than copied; the original stays in the source.
|
|
31
|
+
- The stage is `base`. `art adopt` and `art bust` take `--stage` for other stages (a different look later in a story, say); `--from-art` always uses `base`.
|
|
32
|
+
- `art.json`: `{"unit": "<id>", "stages": {"base": {"adoptions": [{"candidate": "art_candidate_1.png", "sha256": "...", "note": "the person's reason", "date": "...", "bust": {"x": ..., "y": ..., "width": ..., "height": ...}}]}}}`.
|
|
33
|
+
- The bust rectangle is in whole pixels of the adopted picture, chosen by a person so the face is in the middle. It must be inside the picture, square, and at least `art.bust_min_side` on a side; it is only ever shrunk.
|
|
34
|
+
|
|
35
|
+
**Recolour units.** A unit with `recolor.json` (or a sprite palette swap) gets its card art by turning one hue range of its base unit's adopted art. It is never generated, adopted or given a `dot_ref.png`; the base unit needs its adoption and bust first, and the bust rectangle is the base's.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{"base": "<base unit path>", "hue_from": [70, 160], "hue_to": 280, "min_saturation": 20, "saturation": 100, "value": 100}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Pixels whose hue (degrees) is within `hue_from` and whose saturation is at least `min_saturation` percent are turned so the middle of the range lands on `hue_to`; differences within the range are kept. Every other pixel stays byte for byte. `saturation` and `value` are optional whole percentages (default 100, unchanged) that scale the turned pixels, capped at full; 0 or less is refused.
|
|
42
|
+
|
|
43
|
+
**Placeholders.** `art build` on a unit with neither `art.json` nor `recolor.json` writes a placeholder drawn in code: the first of the unit's `colors`, its id and English `name` in large text, and a bust cut at `art.placeholder_bust`. The text uses Pillow's built-in font, so its pixels match only on the same pinned version.
|
|
44
|
+
|
|
45
|
+
### Prompt
|
|
46
|
+
|
|
47
|
+
- Line 1 is `generation.tool_instruction`.
|
|
48
|
+
- Line 2 is `Image: ` + `art.common_prompt` + `art.composition_sentence` + `art.design_rule_sentence` + `design`. The sprite's `common_prompt`, size sentence and `sprite_note` are not used.
|
|
49
|
+
- Then: `--note` (`Changes from the previous candidate: ...`), `art.style_reference_sentence` if `art.style_reference` is set, `art.dot_reference_sentence` if the unit has a built sprite, and the i-th `--variant` (`For this candidate: ...`) on run i.
|
|
50
|
+
- Attached images: the style reference (if set; its path and sha256 go into the record's `style_reference`, and a missing file stops the run) and the unit's `dot_ref.png` (if it has a built sprite; recorded as `reference` with mode `dot`).
|
|
51
|
+
- Edit `art.common_prompt` to set your own card art style, or set `art.style_reference` to a picture in that style.
|
|
52
|
+
|
|
53
|
+
### Steps
|
|
54
|
+
|
|
55
|
+
1. `art status <unit>`: generation count and cap, current adoption, whether it is a recolour (`recolor`), whether its rule exists yet (`recolor_rule`), and whether it has a built sprite (`dot_reference`). For a recolour, write `recolor.json` if needed and go to step 6.
|
|
56
|
+
2. Check `design` in `unit.json`: is the signature item clear? If the unit has a built sprite, it needs a `dot_ref.png`: `art dot-ref <unit>` makes one the first time (idle frame 0, cropped to its opaque pixels, enlarged in `reduce.ref_block` blocks on a magenta margin, like the size-pass reference). After that, every sprite `build` refreshes it (commit the changed file too).
|
|
57
|
+
3. `art generate <unit> --batch 3 [--variant "..."]...`. A unit with a built sprite is refused if `dot_ref.png` is missing or older than the sheet. Candidates go to `<preview>/<unit>/art/`; the comparison sheet goes into the source. At the cap, stop and ask.
|
|
58
|
+
4. Show the comparison sheet and let the person pick. Check together: no resemblance to a known character or trademark; if it has a sprite, the same person; the signature item as described; no text or frame; a face suited to a bust crop. If nothing fits, put their words into `--note` and generate again.
|
|
59
|
+
5. `art adopt <unit> --candidate art_candidate_N.png --note "<the person's reason>" [--bust X Y W H]`. It checks the candidate is recorded, not `invalid`, matches its sha256 and is an opaque 2:3 picture, then copies it into the source. Set the bust here or later with `art bust <unit> --rect X Y W H`; without a bust, `art build` refuses.
|
|
60
|
+
6. `art build <unit> --force` (`--force` because it replaces the placeholder or the previous build).
|
|
61
|
+
7. To adopt again, generate more within the cap and repeat from step 5. The previous adopted file moves back to the preview folder and stays in the record. Set a new bust for the new adoption.
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
dotomata art status botanist
|
|
65
|
+
dotomata art dot-ref botanist # only if the unit's sprite is already built
|
|
66
|
+
dotomata art generate botanist --batch 3 --variant "front view" --variant "slight turn to the left"
|
|
67
|
+
dotomata art adopt botanist --candidate art_candidate_2.png --note "<the person's reason>"
|
|
68
|
+
dotomata art bust botanist --rect 240 110 660 660
|
|
69
|
+
dotomata art build botanist --force
|
|
70
|
+
dotomata art invalidate botanist --candidate art_candidate_3.png --reason "<why it is not that run's picture>"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Backgrounds
|
|
74
|
+
|
|
75
|
+
A background is a 16:9 picture defined by `<source>/backgrounds/<id>/background.json`. Generation, records, comparison sheet, adoption and `invalidate` work like card art, without a bust or stages.
|
|
76
|
+
|
|
77
|
+
| Source (`<source>/backgrounds/<id>/`) | Written by | Content |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| `background.json` | you | `id` (same as the folder), `layout` (a key of `bg.layouts`: `battle` or `backdrop` by default), `colors` (the first is the placeholder colour), `design` (the scene in English). |
|
|
80
|
+
| `bg_candidate_<N>.png` | `bg adopt` | The adopted candidate only; the others stay in `<preview>/backgrounds/<id>/`. |
|
|
81
|
+
| `bg_generation.json`, `bg_batch_*.jpg` | `bg generate` | As for card art. |
|
|
82
|
+
| `bg.json` | `bg adopt` | Adoptions; the last one is used. |
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{"id": "forest_path", "layout": "battle", "colors": ["#4a6b3c"], "design": "a sunlit forest path between tall birches, ferns along the edges"}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- The output is `<bg_output>/<id>.png`: the adopted image scaled with LANCZOS to cover `bg.size` (rounding up) and cropped in the middle, because the model never returns exactly that size. RGB, no metadata. Without an adoption, a placeholder in the first colour with the id.
|
|
89
|
+
- Prompt: `Image: ` + `bg.layouts[layout]` (with the description in place of `{design}`) + ` ` + `bg.common_prompt`, then `--note` and the variant. No reference images.
|
|
90
|
+
- `battle`: a side view with a flat ground band across the lower part where small characters stand in a shallow diagonal, the middle of the ground kept simple, so sprites read clearly on it.
|
|
91
|
+
- `backdrop`: a calm, evenly lit scene seen straight on, for menu screens that panels will mostly cover.
|
|
92
|
+
- Add your own layouts in `bg.layouts`.
|
|
93
|
+
- Cap per background `bg.cap_per_background`, batch `bg.batch_max`.
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
dotomata bg status forest_path
|
|
97
|
+
dotomata bg generate forest_path --batch 3
|
|
98
|
+
dotomata bg adopt forest_path --candidate bg_candidate_1.png --note "<the person's reason>"
|
|
99
|
+
dotomata bg build forest_path --force
|
|
100
|
+
dotomata verify backgrounds/forest_path
|
|
101
|
+
```
|