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.

Links

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amos_abk-0.2.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amos_abk-0.2.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file amos_abk-0.2.0.tar.gz.

File metadata

  • Download URL: amos_abk-0.2.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.21

File hashes

Hashes for amos_abk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ad5fd8414f9143011e7a35dc1301ea05611ff17d76df2f92a754ec11bfabfe24
MD5 763931bfcff6d375fa5366e5493b7150
BLAKE2b-256 2d920d8d4419e6a185a45659d68e3e8134611edea6cb4a1a1019e9ccbf1f3e5e

See more details on using hashes here.

File details

Details for the file amos_abk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: amos_abk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.21

File hashes

Hashes for amos_abk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a801182468d0d81ea7fb6e5a73e9fa2031d42c71555c8f00794637a0c831b8d
MD5 d7b12d401308982d7693b684e5a3c9ec
BLAKE2b-256 4a4774c4b8684235c5c81f94120e146f5cfaca4290aae59f9b25215c2abf0f4e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 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