Skip to main content

Python bindings for RECOIL, the Retro Computer Image Library

Project description

pyrecoil provides Python bindings to RECOIL, the Retro Computer Image Library, allowing you to open over 500 image file formats from retro computers.

Installation

pip install pyrecoil

pyrecoil is most useful when installed in conjunction with Pillow, the active fork of the Python Image Library:

pip install Pillow

Usage

from recoil import RecoilImage

# load image from disk and decode it:
img = RecoilImage("foo.lbm")

# load image from an existing file handle:
# (filename must still be provided, as a hint to the decoder)
img = RecoilImage("foo.lbm", f)

# inspecting properties:
img.colors  # number of colors used in the image
> 16

img.frames  # number of alternating frames (used for 'interlace' / 'gigascreen' effects)
> 1

img.size  # return a tuple of (width, height)
> (320, 200)

img.original_size  # for images that have been resized to account for non-square pixels
> (320, 200)

img.platform
> 'Amiga'

# Retrieving pixel data -
# returns a bytearray consisting of three bytes (r, g, b) for each pixel,
# in left-to-right, top-to-bottom order
pixels = img.get_pixels()

# convert to a PIL / Pillow image object:
pil_image = img.to_pil()
pil_image.save('foo.png')

Build notes

The RECOIL library itself is implemented in the Ć Programming Language. For ease of distribution, the generated C output (recoil.c and recoil.h) from the cito transpiler is included in the package - this, along with recoil_interface.c, forms the Python extension module.

Author

Matt Westcott - matt@west.co.tt, http://twitter.com/gasmanic

Project details


Download files

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

Source Distribution

pyrecoil-0.3.7.tar.gz (137.3 kB view details)

Uploaded Source

Built Distributions

pyrecoil-0.3.7-cp311-cp311-macosx_10_9_universal2.whl (615.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

pyrecoil-0.3.7-cp310-cp310-macosx_10_9_universal2.whl (615.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

pyrecoil-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl (311.7 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.7-cp38-cp38-macosx_10_9_x86_64.whl (311.7 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.7-cp37-cp37m-macosx_10_9_x86_64.whl (311.7 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file pyrecoil-0.3.7.tar.gz.

File metadata

  • Download URL: pyrecoil-0.3.7.tar.gz
  • Upload date:
  • Size: 137.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for pyrecoil-0.3.7.tar.gz
Algorithm Hash digest
SHA256 b61fd7b1bf904458d879ea2e620fe72e242d46ce1a8c4e6a68ae9e1a6496bb86
MD5 5513238e6c48dc51ec65fdb710f62b6d
BLAKE2b-256 7ddf2078c05fcc94cb74d38de81ea5f6ead5e44232bdee39cfeea947072f5978

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.7-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.7-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 aaf9ca289560d808ff96dd82eb2f961d4ba5c2f85b7bbbe2c7b6dcf42cc916b3
MD5 155cda72185fdfb596d378b11bbee3ba
BLAKE2b-256 6382f476093a816dcae8fe7cd65345bb6279593dfbfee05cc3c6f25bc6b83179

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.7-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.7-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 bb39d984520b9887cbc2677e41b6d2efe343b4705f0f42a73ef6d1552e0c0a26
MD5 62c1de0e4c583d07b6c2844ec40947fe
BLAKE2b-256 8fb924d303f4536264f0a89215a5826c2a01609753ac7d1cb055038a2a5685b1

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7c774c8411bf84a886ee1d0025dc9092bf52feeff2a1f51a05c46918a229a9e6
MD5 b0b4347445cd1325e208607233abc391
BLAKE2b-256 9be26b508bb202d0de9505e01f806d6849d5d087602208a22aa4215d61465aec

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.7-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c5cd8e9f169947ff6900e7183b85940a9e68d908247591fd5fe2074d7475e20a
MD5 2e1771e67e4f12986e212a93076ea2e3
BLAKE2b-256 53f317abf623e76f114ada5b6df62755f457ac29ff4e7ea90d0c96f6f494134e

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.7-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5711586231a7f140b69a0e9c59ab555327cb240dfeb54ff067c7ae1526a96e19
MD5 f0ef297f8bb658d142f393d455084184
BLAKE2b-256 2dfa33e8261c0ea876b9874646785d9b5b0c3bf37a3a1b0cd1dbe4229593f0ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page