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 Fusion Programming Language. For ease of distribution, the generated C output (recoil.c and recoil.h) from the fut transpiler is included in the package - this, along with recoil_interface.c, forms the Python extension module.

Author

Matt Westcott - matt@west.co.tt, https://icosahedron.website/@gasman

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.11.tar.gz (141.0 kB view details)

Uploaded Source

Built Distributions

pyrecoil-0.3.11-cp313-cp313-macosx_10_13_universal2.whl (566.1 kB view details)

Uploaded CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)

pyrecoil-0.3.11-cp312-cp312-macosx_10_9_universal2.whl (563.8 kB view details)

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

pyrecoil-0.3.11-cp311-cp311-macosx_10_9_universal2.whl (563.8 kB view details)

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

pyrecoil-0.3.11-cp310-cp310-macosx_10_9_universal2.whl (563.8 kB view details)

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

pyrecoil-0.3.11-cp39-cp39-macosx_10_9_x86_64.whl (292.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.11-cp38-cp38-macosx_10_9_x86_64.whl (292.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyrecoil-0.3.11.tar.gz
  • Upload date:
  • Size: 141.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for pyrecoil-0.3.11.tar.gz
Algorithm Hash digest
SHA256 6047250cf301d06ab9f4fb1123680cdf47bf08ef6808e8d2828d5101eb526d49
MD5 8746ecff64fd5c2c1167ff7f7bbd3b98
BLAKE2b-256 0a476cfa824a7b9253748f6cc2d3c2fe238db3be8c1f7cf1d2968218ffb88909

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.11-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 10c84b1f5480575e403c034b19d9ae8f340ae01d533de1ab275ce96af8900036
MD5 6dfbb6e24cd394733926373d3016f8fa
BLAKE2b-256 3f4006eca6d09dab40b6cea3c7a9b73a477834eb787f2c1f123da8c92f0edc7b

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.11-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1ed0bc6a8e42f64eaf62ebb0de1da92e7830f2ee999f73202a5dd18eb813787f
MD5 6e59a0cf6333735f9b8b0b36e2c2f078
BLAKE2b-256 4bf61803db453045605a3cec69f3a7e5b4912fed772aabc356a8d82946f31cbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e9346588cd5dc2058276b8ec9b8574c897f7fbc6ad90454f42837c33edd4804b
MD5 33d6522f3710f339c35f95417f3e95e2
BLAKE2b-256 8848fda82f1eee61e21f6ee0b83ce0375e686119c806e6c40bb62f03ddafb079

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7fc24099bf4748b50a9864f3d544c35c6d11443ba55dd77e85bfbdbda1087efd
MD5 105fcca5901a71d5a7ab430bb9b2c0e3
BLAKE2b-256 3b1ea26f531be83217df73f3f8ed4181519be2c9b839634cf7797e7f151e5e6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 aeb019a866c9d71a7844894c5206101009f5287f1e6aefbdf825367ef2c58db8
MD5 1fca7f469530e30e86c633ac82a61bed
BLAKE2b-256 27ba0ce7f736a47e55f26e83072601ec0c07dc3396764cdb162453b80a828705

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.11-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1ae3c5de1087fa8e5cc1951470e2166b727bd14345b9cf5ee4004cbeafabb098
MD5 0a9f9cb57d697886ad9b1ae7757d9402
BLAKE2b-256 091d43d1c9ade4a0ec659d6f3baea278f40ac7eb4ab7f15189459b922cc0c3b6

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