Import a sprite sheet
Récit draws its own sprites from data: a ```pixel grid, or a seeded recipe
::pixel{gen=. Anything richer, real poses, layers, hand shading, is made in a
drawing tool outside Récit and imported as a file. Récit never imports the code of those tools
and never calls an image model: it reads the sheet, checks its size when it plays it and keeps where
it came from.
The target: codex-pet-v1
A character sheet has one layout in v1, codex-pet-v1: 1536 × 1872 pixels, 8 columns by 9 rows,
cells of 192 × 208, unused cells transparent. One pose per row, in this order: idle (6 frames),
running- (8), running-left (8), waving (4), jumping (5), failed (8), waiting (6),
running (6), review (6). A sheet of any other size is an error ("unknown layout"), never a
guess: the commands that play the sheet (recit build, recit render, and recit validate on a
motion story) stop on it.
To start from a placeholder rather than an empty canvas, generate one and retouch it:
Shell
The source is either a recipe in JSON (figure.json: { "gen":, what
the workshop's "Copy JSON" gives for an untouched seed), or a Markdown file (figure.md) whose
first ```pixel fence or ::pixel{gen= directive is the sprite. Any other JSON, a story
twin or a pixel block, is refused: for a retouched grid, paste the workshop's "Copy Markdown" into
a .md file. The command writes figure. beside the sheet, its provenance, with
origin:.
From a drawing tool
| Tool | How to export | Licence of the tool |
|---|---|---|
| Piskel | Export → PNG → spritesheet, 8 columns, frame size 192 × 208; one row per pose, in the order above | Apache-2.0, a web app: nothing is copied |
| Aseprite / LibreSprite | File → Export Sprite Sheet, by rows, one tag per pose named after its row; keep the JSON, then recit pixel import (below) | proprietary / GPL-2.0: external tools only |
| claude-pxl | render its .px.ts to a PNG sheet, then lay the frames out as above | MIT, no release yet: Récit does not depend on it |
| LPC generator | export the PNG and the credits CSV; re-lay the frames into codex-pet-v1 | code GPL-3.0, art per file (see below) |
From Aseprite's JSON
Aseprite lays its frames out its own way; recit pixel import lays them out again in
codex-pet-v1, without redrawing a pixel. In File → Export Sprite Sheet, tick « JSON Data » (Array
or Hash) and « Tags », leave « Trim Sprite » and « Trim Cels » unchecked (a trimmed frame is centred
on its own size and the pose jumps; the import warns), and name each tag after a pose (idle,
running-…, case aside):
Shell
The PNG named by meta.image is read beside the JSON. Each tag fills the row of its pose, in its
direction (forward, reverse, pingpong); a row always plays the layout's count of frames, so
extra frames are dropped and a short tag repeats its last one, both with a warning. A pose with no
tag keeps a transparent row; a tag that names no pose, or two tags that name the same pose (the last
one wins), is a warning; no pose at all is an error, and so is an output that would overwrite the
JSON or its PNG. Frames are scaled by the largest whole factor that fits the 192 × 208 cell, centred
and pixelated; a larger frame is shrunk to fit, never cropped. The durations are those of the
layout, not Aseprite's. The command writes figure. beside the sheet with
origin:, the PNG in references, and the author and license you give.
Then, for the sheet figure.webp:
- Copy it next to the bible entry of the character (
cast/).figure/ figure.webp - Write its provenance
figure.(webp.json kind:):"asset" originishumanfor a drawing,mixedfor a retouched generated sheet,aifor a model's output,codefor a sheet written byrecit pixel sheet. Giveauthorandlicense. - Add
::sheet{src=./to the entry.figure. webp layout= codex- pet- v1} - Check that the sheet is still pixel art:
recit pixel grid figure.webp. A tool that resized the sheet with smoothing, or exported it anti-aliased, leaves colours between the art pixels; the command finds the true grid of each drawn cell (the idea of pixeldetector), requires one whole scale of at least ×2 for all of them, and names every cell that is off its grid. Each cell may sit at its own offset.--tolerance 2accepts colours one or two steps apart (a lossy WebP),--min-scaleraises the bar. It exits with 1 when the sheet is not a true grid. - Run
recit validateon the story that names the bible incast:: an image next to the bible without a provenance file is a warning, an error with--strict. The size of the layout is checked only where the sheet is played (a motion story,recit build,recit render), and thelicenseandauthorof the provenance are yours to fill in: nothing checks them yet.
Licences
The art of a sheet is not the code of the tool that drew it: each has its own terms.
| Case | What Récit does |
|---|---|
| GPL code (LPC generator, lpc-spritesheet-mcp, LibreSprite) | never imported nor copied into a package: a link or an external tool only |
| LPC art (CC-BY-SA, GPL, CC-BY, OGA-BY) | credit per file: copy the authors and licences of the exported credits CSV into the provenance (author, license) and keep the CSV next to the sheet; Récit does not read the CSV yet, so nothing refuses a sheet without credits; CC-BY-SA asks the derived sheet (and, depending on use, the story) to be shared alike; no LPC asset in the examples |
| CC BY 4.0 art | a visible credit is required; avoided by default |
| Art under its own terms (avataaars, bottts, Multiavatar) | excluded |
| Non-commercial licences | neither a dependency nor a copy |
| No LICENSE file | all rights reserved: read only |
| Apache-2.0 (hatch-pet, Piskel) | compatible; reusing its text or code needs a line in NOTICE |
| AI output | the provider's terms apply, and the provenance says aiGenerated: |
The examples of Récit stay Lorem Ipsum: abstract, generated sprites, never third-party art.