# AnimStream art direction for Originals

> Binding for every AnimStream Original (checklist points 6 and 13). In a game
> repository this file is `animstream/ART-DIRECTION.md`; the German version is
> `animstream/ART-DIRECTION.de.md`. Web version:
> https://animstream.com/developers/games/art-direction

Every Original gets one consistent, high-quality look in the game, on the Gift
Wall, on the preset cards and in the store. A plain style sentence is not enough
for that. What makes the images look like the ones of AnimStream's GTA and
Supermarket mods is: **reference images** from those mods, a **two-step
process** (paint, then cut out), a **fixed post-processing** and a **visual
check** as a Gift Wall. The tool `tools/art/generate-action-images.mjs` does all
of it.

## 1. The common look of all AnimStream images

### Action images (Gift Wall, preset cards, store)

- **Glossy 3D cartoon clipart** like the mod cliparts in `animstream/art/reference/`.
- **One clear motif**, centred, with a strong silhouette, rounded chunky shapes,
  saturated colours, soft studio light with a bright rim light, a slight
  three-quarter view.
- **Transparent background**, no frame, no ground shadow, no scenery.
- **Readable as a 64 px tile** on a dark and on a light background.
- **Game reference:** every image contains at least one element of the game's
  world (the character, the mascot, game objects in the game's colours), so the
  set belongs together and does not look generic.
- **Text:** none. Only exception: one very short, self-explanatory sign that the
  action needs to be understood ("2X", "TAX", "GAME OVER"); at most one word or
  two short words, large and legible, rarely used.
- **Good and evil at a glance:** mercy actions (help the streamer) with green
  accents or a check mark; sabotage actions with red or orange accents, a
  warning or prohibition sign.
  The colour follows the action's `effect` in the manifest: `"effect": "help"` =
  `kind: "mercy"` (green, the left side of the split Gift Wall), `"effect":
  "sabotage"` = `kind: "sabotage"` (red/orange, the right side). Image and
  `effect` must agree.
- **Mascot:** if the game has one, describe it with its own reference image and
  use it in **at most a quarter** of the images, otherwise they all look alike.

| Good | Bad |
|------|-----|
| One motif that fills ~84 % of the square, transparent around it | A white or coloured square behind the motif (not cut out) |
| Thick shapes that survive 64 px | Fine details, thin lines, a tiny motif in a large empty canvas |
| Game objects in the game's colours | A generic icon that could belong to any game |
| Green for help, red/orange for sabotage | Every image in the same colour |
| No text, or one short sign | Sentences, labels, UI frames, logos |

## 2. Reference images (style pack)

- `animstream/art/reference/` (in the kit: `art/reference/`) holds five approved
  AnimStream cliparts from the GTA and Supermarket sets with a transparent
  background. They are the **style reference** for the generator. Licence
  (`art/reference/README.md`): only as a reference for image generation, never
  shipped in a game, a build or store material.
- **Never use TikTok gift images**, neither as references nor in the game: they
  are TikTok's brand, and the Gift Wall shows the gifts itself.
- The game adds its own references: the mascot (`tools/art/mascot.png`), game
  objects and the colour palette, for example a screenshot crop. List them in
  `tools/art/action-prompts.json` (`references`, `mascotReference`).

## 3. Process: generate in two steps

Most image generators deliver no real transparency. Therefore:

1. **Paint** with a model that accepts reference images (fal.ai
   `fal-ai/nano-banana/edit`, OpenAI image models, Codex image generation).
   Prompt = style template + subject + action, background **pure white and
   empty**, aspect ratio 1:1, with the reference images (style pack + mascot).
2. **Cut out** with a segmentation model (fal.ai `fal-ai/birefnet/v2`, model
   "General Use (Heavy)", `refine_foreground` on); the result is a PNG with alpha.
3. **Post-process** (local, deterministic): cut away the transparent border, put
   the motif on a square with about 8 % air, scale to 512×512 (Lanczos),
   optimize the PNG. Over 300 KB: 448, then 384 px; last fallback 256 colours.
4. **Visual check:** look at all images as a contact sheet and as a Gift Wall
   preview (tiles with image, action name, gift and coins, grouped by preset)
   on a dark and on a light background. Regenerate bad images one by one.
5. **Approval:** the developer first sees **2 test images** (one mercy, one
   sabotage). Only after the approval are all others generated, in parallel.

```sh
cp animstream/art/action-prompts.example.json tools/art/action-prompts.json   # once, then fill it
node tools/art/generate-action-images.mjs --dry-run        # check the prompts (nothing is sent)
node tools/art/generate-action-images.mjs --test 2         # steps 1-4 for two images, opens the preview
#   -> show the two images to the developer and wait for the approval
node tools/art/generate-action-images.mjs                  # every missing or placeholder image
node tools/art/generate-action-images.mjs --preview        # contact sheet + Gift Wall preview
node tools/art/generate-action-images.mjs --only spawn,heal   # redo single images
node tools/art/generate-action-images.mjs --check          # before packing: no placeholders, no findings
```

Providers: `--provider fal` (default), `--provider openai`, or `--provider files`
when your agent paints with its own image tool: it paints the prompt in
`build/art-raw/<id>.prompt.txt` and saves `build/art-raw/<id>.paint.png`, then
the tool cuts out, post-processes and checks. Cut-out: `--cutout fal`
(default), `--cutout local` (offline white key; check the edges) or
`--cutout none` (the painter delivered real transparency). Raw images stay in
`build/art-raw/` (not shipped) so you can see what the generator delivered.

Without any way to generate images, run
`node tools/package/placeholder-action-images.mjs` and report checklist point 6
as open. Placeholders are never released.

## 4. Prompt template (binding)

`animstream/art/action-prompts.example.json` is the template. Every game copies
it to `tools/art/action-prompts.json` and fills it. The file is also the record
of every prompt (it replaces writing the prompts into GAME-DESIGN.md).

| Key | Content |
|-----|---------|
| `style` | The style template with `{SUBJECT}` and `{ACTION}`. Keep the AnimStream wording ("exactly like the rendering style of the reference clipart images", white background, "no text, no letters, no numbers, no logo, no frame, no ground shadow, square 1:1"); replace only the sentence about the game world and its colours. |
| `kinds` | Accent sentence per kind: `mercy` (green, check mark) and `sabotage` (red/orange, warning sign). |
| `mascot` | Description of the mascot; appended only to actions with `"mascot": true`. |
| `mascotReference` | The mascot's reference image, sent only with mascot actions. |
| `references` | Style pack and the game's own references (default `animstream/art/reference/*.png`). |
| `actions` | Per action ID: `subject` (what is shown), `action` (what happens), `kind` (`mercy` or `sabotage`), optional `mascot` and `text` (the one approved sign, for example `"2X"`). |

Example entry:

```json
"freeze-zombies": { "subject": "a cartoon zombie head inside a block of blue ice", "action": "the zombie frozen solid with frost crystals", "kind": "mercy" }
```

The style template of the example file:

```text
Glossy 3D cartoon clipart icon of {SUBJECT}, {ACTION}, exactly like the rendering style of the reference clipart images: one clear centred motif with a bold readable silhouette, chunky rounded shapes, vibrant saturated colours, soft studio lighting with a bright rim light, subtle specular highlights, slight three-quarter view, readable as a 64 px tile. It belongs to the world of <GAME>: use its colours, <PALETTE>, and its objects (<OBJECTS>). Isolated on a plain pure white empty background, nothing else in the picture, no text, no letters, no numbers, no logo, no frame, no ground shadow, square 1:1.
```

## 5. API keys

The tool reads `FAL_KEY` or `OPENAI_API_KEY`, otherwise the OS secret store
(service `fal-ai` or `openai`). Keys are never printed, logged, written to files
or chats, or passed on a command line. **The developer stores the key, never
the agent, and never in the chat:**

```sh
security add-generic-password -a "$USER" -s fal-ai -w                  # macOS: asks for the key
secret-tool store --label="fal.ai API key" service fal-ai              # Linux: asks for the key
cmdkey /generic:fal-ai /user:fal-ai /pass                              # Windows: asks for the key
```

(For OpenAI use `openai` instead of `fal-ai`.) Alternatively the developer sets
`FAL_KEY` in the terminal before starting the agent. If no key is found, the
agent shows these commands to the developer and waits.

## 6. Checks

| Check | Where | Result |
|-------|-------|--------|
| PNG/WebP, square, 256–1024 px, ≤ 300 KB, alpha channel | `animstream-pack`, release CLI, `--check` | error |
| Placeholder image | `animstream-pack` (warning), release CLI (refused), `--check` | must be replaced |
| Fewer than 5 % transparent pixels (not cut out) | `animstream-pack`, release CLI, `--check` | warning; `--check` fails |
| ≥ 90 % of the visible pixels in one colour | `animstream-pack`, release CLI, `--check` | warning; `--check` fails |
| Almost no visible pixels | `animstream-pack`, release CLI, `--check` | warning; `--check` fails |
| Mascot in more than a quarter of the images, missing prompts, no kind | `--check` | advice |
| Readable at 64 px, game reference, colours, text rule | contact sheet + Gift Wall preview | by eye, before the approval |

## 7. Store material (same art direction)

The same colour world and the same mascot appear in the game, the action images
and the store material. Generate store images with the same references and the
same style template (replace the "isolated on white" part with the layout
below; cover and splash keep their background).

| Item | Size | Rules | Check |
|------|------|-------|-------|
| Cover | 1920×1080 (16:9), de and en | Game logo large, mascot or main motif, a game scene in the background; keep the **lower left corner free** for the "animstream ORIGINALS" badge. | Readable as a 480×270 thumbnail; nothing important in the lower left quarter. |
| Icon | 1024×1024 (or 512×512) | Only the mascot or the main motif, **no text**. | Recognisable at 32 px. |
| Splash | portrait (for example 1080×1920), Godot boot splash and start screen | Main motif in the upper two thirds, a **calm lower area** for the logo. | Logo area without detail; matches the cover. |
| Trailer | 16:9 and 9:16, each in German and English (four videos) | Recommended: real gameplay driven by an autopilot, cut to the beat of the music; every action appears with a gift card ("@name sends · gift · coins"); end card with icon, logo and "Jetzt im AnimStream Store" / "Now in the AnimStream Store". | MP4 rules of the release skill; text readable on a phone. |
| Poster | one per trailer, same aspect ratio, JPG | The strongest scene of the trailer. | Matches its trailer's language and format. |

## 8. Report to the developer

Show the two test images with the preview and ask for the approval before the
rest. After the full set: the preview file, the list of regenerated images, the
result of `--check` and anything still open (placeholders, missing references,
store material). Never claim the art is done while `--check` fails.
