Skip to main content

pillow_zx_spectrum

Jetpac Treasure Island Dizzy Daley Thompson's Decathlon Jet Set Willy II

Pillow loaders for ZX Spectrum loading screens, extracted from tape, disk and snapshot files in the wild.

Open a tape, disk image, or snapshot with Image.open(...) and Pillow gives you a 256×192 RGB image with the original Spectrum colours. Files that contain multiple screens (multi-load games, multi-side disks) expose them as Pillow frames via seek() / n_frames.

Install

pip install pillow_zx_spectrum

Command line

Open a Spectrum image up in your image viewer, or write a found frame to disk:

zx-screen "Glug Glug (1984)(CRL).tap"
zx-screen "Moonwalker (Erbe).dsk" --frame 1 -o moonwalker.png

Usage

from PIL import Image
import pillow_zx_spectrum  # registers the plugins on import

img = Image.open("Glug Glug (1984)(CRL).tap")
img.save("loading-screen.png")
print(img.size)                   # (256, 192)
print(img.info["pixel_aspect_ratio"])  # (1, 1)

Multi-screen containers (disks, multi-load tapes) expose every screen they hold. Iterate with the stock Pillow helper:

from PIL import ImageSequence

img = Image.open("Moonwalker (Erbe).dsk")
print(img.n_frames)  # e.g. 2
for i, frame in enumerate(ImageSequence.Iterator(img)):
    frame.save(f"moonwalker.{i}.png")

How it works

A file becomes a stream of (addr, body, name, kind) events, and if one is the same size as a SCREEN$, or it overlaps the $4000-$5AFF graphics region, then you'll get an image for each one (assuming it looks sensible).

Supported formats

Most of them tbh:

Tape

Ext Format Notes
.tap TAP Plain ROM-loader block stream
.tzx TZX Versioned tape with timing/meta blocks; we extract from standard (0x10) and turbo-speed (0x11) data blocks. Custom-loader pure-data blocks (SpeedLock / BleepLoad / Alkatraz, block 0x14) are skipped — they need per-protection decoders.
.scr SCREEN$ Raw 6912-byte screen dump

Disk

Ext Format Notes
.dsk CPC DSK Spectrum +3 / Amstrad CPC, both standard and "Extended" variants. CP/M file system parsed (handles fragmented allocation). Auto-detects single/double-sided and various reserved-track conventions.
.scl TR-DOS packed "SINCLAIR" magic, compact distribution format used in Russian-speaking scene
.trd TR-DOS raw Sector-by-sector TR-DOS floppy dump; tolerant of truncated images
.mgt DISCiPLE / +D Side-interleaved 80-track disk for the MGT DISCiPLE & +D interfaces. CODE/SCREEN$ files reassembled by following the per-sector chain.
.d40, .d80 Didaktik MDOS Czechoslovak Didaktik D40/D80 floppy. MDOS file system with non-standard FAT12 packing (the 12-bit entries' high nibbles are byte-swapped relative to MS FAT12). Auto-detects geometry from the boot sector "SDOS" marker. Most TOSEC Czech games use packed loaders so plain SCREEN$ extraction is rare.

Microdrive

Ext Format Notes
.mdr Microdrive cart Sector-by-sector dump of a Spectrum Microdrive cartridge (543-byte sectors with mod-255 checksums). Files reconstructed by gathering all records belonging to a filename and stripping the inline 9-byte header. PRINT# files are not handled.

Snapshot

Ext Format Notes
.sna SNA Classic 48K (49179 bytes) / 128K (131103 or 147487 bytes) snapshot
.z80 Z80 Gerton Lunter format (v1, v2, v3); 48K and 128K with bank decompression
.szx SZX / ZX-State Spectaculator's modern chunked snapshot, with zlib-compressed RAM pages
.slt SLT "Super Level Loader" — a Z80 snapshot with a table of additional screens (each becomes a frame)

For 128K snapshots the shadow screen (bank 7) might be exposed as an extra frame.

Unsupported

You'll get UnidentifiedImageErrors for sampled audio tapes, custom loaders, copy protected games and other weird things. It doesn't run any Z80 machine code so programmatically made screens aren't decoded.

License

WTFPL with one additional clause:

  1. Don't blame me.

Do what you like, but you're to blame.

Metadata

Release files for pillow-zx-spectrum 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pillow-zx-spectrum 0.2.1
File Size Uploaded Provenance Actions
pillow_zx_spectrum-0.2.1.tar.gz 41.2 kB Without provenance Details for pillow_zx_spectrum-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pillow-zx-spectrum 0.2.1
File Interpreter ABI Platform Actions
pillow_zx_spectrum-0.2.1-py3-none-any.whl Python 3 none any Details for pillow_zx_spectrum-0.2.1-py3-none-any.whl

Total release size: 97.7 kB

Release files / pillow_zx_spectrum-0.2.1.tar.gz

Download URL pillow_zx_spectrum-0.2.1.tar.gz
Size 41.2 kB
Tags Source
SHA-256 checksum
How to use checksums
17bed6e69cd8366f6830c6cd3e669b26fd5f750e09129b2cf509e69d4f9f5b6f
BLAKE2b-256 checksum
How to use checksums
f7c855176e33754bca76fea2b36e3864705394527844c88cc515fb41ab4d33ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Release files / pillow_zx_spectrum-0.2.1-py3-none-any.whl

Download URL pillow_zx_spectrum-0.2.1-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
831832dee3bac69a3974f7de25a59a948269d7bcf31cc4a781e531de2777c794
BLAKE2b-256 checksum
How to use checksums
3db0d3d98ff1aef61e0f442d30db7284f7d5d7fa0b2afdd3d590487e5ff09fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.22

Security for pillow-zx-spectrum 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page