Skip to main content

amos-abk

A Python library for loading AMOS .abk bank files from the Amiga.

Parses the container format and three image bank types:

  • Sprites — hardware sprite images with hotspot and transparency
  • Icons — software bob images (same format as sprites)
  • Pac.Pic. — packed full-screen pictures with three-stream RLE compression

Non-image banks (Music, Samples, Amal, Datas) are loaded as raw DataBank objects.

Install

pip install amos-abk

Library usage

from amos_abk import load, parse_sprites, parse_packed_picture

# Load a bank file
abk = load("sprites.abk")
print(abk)  # AbkFile([Sprites])

# Parse sprites and convert to PIL Images
sprites = parse_sprites(abk.banks[0].data)
for i, sprite in enumerate(sprites):
    sprite.to_image().save(f"sprite_{i}.png")

# Parse a packed picture
abk = load("picture.abk")
pic = parse_packed_picture(abk.banks[0].data)
pic.to_image().save("picture.png")

# Access raw data
print(pic.width, pic.height, pic.num_planes)
print(pic.palette[:4])  # first 4 RGB tuples

Pillow plugin

import amos_abk registers a Pillow plugin, so you can open .abk files directly:

from PIL import Image
import amos_abk

img = Image.open("sprites.abk")
img.save("first_sprite.png")

# Multi-frame: seek through all images in the file
for i in range(img.n_frames):
    img.seek(i)
    img.save(f"frame_{i}.png")

# The parsed AbkFile is available in metadata
abk = img.info["abk"]
print(abk.banks[0].name)

Extract all images

The images() function extracts every image from every bank in a file:

import amos_abk

# From a file path
imgs = amos_abk.images("sprites.abk")
for i, img in enumerate(imgs):
    img.save(f"image_{i}.png")

# Or from an already-loaded AbkFile
abk = amos_abk.load("sprites.abk")
imgs = amos_abk.images(abk)

Format overview

AMOS was a game-creation environment for the Amiga, released in 1990. It stored graphics and other resources in .abk memory bank files.

Bank container

Each .abk file contains one or more banks, either bare (AmSp/AmIc magic) or wrapped in an AmBk header with a bank number, name, and memory type. Bank sets (AmBs magic, usually .abs files) hold a count followed by any mix of these.

Sprite and icon banks

Sprites and icons share the same format: a count, per-image headers (dimensions, bitplane count, hotspot), interleaved planar bitmap data, and a shared 32-entry 12-bit Amiga palette.

Pac.Pic. banks

Packed pictures are compressed full-screen Amiga images. They have two layers:

  1. Screen header (magic 0x12031990) — dimensions, display window, flags, and palette
  2. Packed bitmap (magic 0x06071963) — three-stream RLE compression where POINTS controls RLEDATA, and RLEDATA controls PICDATA

License

WTFPL: do as you like, but don't blame me if it banks your sprites.

Release files for amos-abk 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 amos-abk 0.2.1
File Size Uploaded
amos_abk-0.2.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amos-abk 0.2.1
File Interpreter ABI Platform
amos_abk-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / amos_abk-0.2.1.tar.gz

Download URL amos_abk-0.2.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
62b0e3cfc3c334b48f3b69c0a1a6f5ad5c050237fa443e5747d5a41b15ce65d9
BLAKE2b-256 checksum
How to use checksums
c6b030500a9744f662bde1dd826183a8d8fe33d7c4e8e6769a9b56c1fab6bf97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

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

Download URL amos_abk-0.2.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5583ae325abe03c059b55d5271c421a165e63bb44c53e545752343a57bffe7d7
BLAKE2b-256 checksum
How to use checksums
5af0bf1e7e92be78a62c42e8b8ba32d8a023c61637d31ec184e653994a39afbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

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