zx-graphics-assetslisted
Install: claude install-skill dtz-labs/zx-skills
# ZX Spectrum graphics assets (images → .scr, sprites, UDGs)
This skill converts images into the formats the ZX Spectrum actually uses, and
explains the byte-level rules so the output is correct rather than sliced or
mis-coloured. It bundles **runnable converters** — you don't hand-pack bytes.
Two jobs:
1. **Full-screen images → `.scr`** (a 6912-byte loading screen). Use
`scripts/png2scr.py`.
2. **Artwork → 8×8 cell data** (UDGs for BASIC, sprite tables for asm/C). Use
`scripts/sprite_extract.py`.
The hard parts are two facts about Spectrum video, both covered in depth in the
references: the pixel display file uses a **non-linear address layout**, and
colour is stored **per 8×8 cell with only two colours each** (colour clash).
This skill stays consistent with the screen/attribute model documented in the
`zx-spectrum-basic` skill's `references/graphics.md` — read that for the BASIC
side (PLOT/DRAW, UDGs, ATTR).
## The .scr format in one screen
A `.scr` is a raw dump of screen memory, **6912 bytes**:
- **6144 bytes** pixel display file (loads to `0x4000`) — 1 bit/pixel, 256×192,
bit set = ink. **Non-linear** layout (see below).
- **768 bytes** attribute file (loads to `0x5800`) — 1 byte per 8×8 cell,
32×24, linear.
**Non-linear pixel addressing.** For pixel `(x, y)`, `x` 0–255, `y` 0–191, the
byte offset inside the 6144-byte region and the bit within it are:
```
third = y >> 6 # which vertical third: 0, 1, 2
char_row = (y >> 3) & 7 # char