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, 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.9.tar.gz (139.8 kB view details)

Uploaded Source

Built Distributions

pyrecoil-0.3.9-cp312-cp312-macosx_10_9_universal2.whl (564.9 kB view details)

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

pyrecoil-0.3.9-cp311-cp311-macosx_10_9_universal2.whl (564.9 kB view details)

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

pyrecoil-0.3.9-cp310-cp310-macosx_10_9_universal2.whl (564.9 kB view details)

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

pyrecoil-0.3.9-cp39-cp39-macosx_10_9_x86_64.whl (298.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.9-cp38-cp38-macosx_10_9_x86_64.whl (298.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.9-cp37-cp37m-macosx_10_9_x86_64.whl (298.0 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyrecoil-0.3.9.tar.gz
  • Upload date:
  • Size: 139.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for pyrecoil-0.3.9.tar.gz
Algorithm Hash digest
SHA256 8976bc8f2250f7579b7e5fde1536ceae148886626a1ba43578e82073fbe8538e
MD5 7b30e9e0d63055416ad5e3d4280fc972
BLAKE2b-256 a911848c957f7a533a0dd3cae2f129d3ecbea41d43980cda6d5bc8730bd7affa

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 82fa24d0de33f50ae1a1e023f342124f3dd60d0161f52c75e51eb9be08906097
MD5 05a7182b771618feabc0018e1638266b
BLAKE2b-256 2b0f904a4d8b6dae6069b30622e2187e2c7faea44ad5180dd9fad8231bc27e83

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4b99222eedd53d872c00c88194325a13c5a41cdef3ba0a79752d6f2194bf92e3
MD5 00f28c2133b03d7456585af4b907ea19
BLAKE2b-256 06497944940d475025aec9d4ee756e635c6cb9a3535349171c1c10665dc18513

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9dbb68d494fb62828211beca73dfde424678d6e4f92625984fa04d4a0b498472
MD5 37fefb91d21e50333431de8b81495911
BLAKE2b-256 09607e02c7f64332f618479c2569686085dc5c811eeb13384a39f34f48b6bb48

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7087e08509c66d8026cdbdaa8426f52bb288d7eedab12b1e0288a85e21f96a89
MD5 6c41da6ca40df35aef0439578ed4e65f
BLAKE2b-256 7f65c7a8f3db83c0cbcfecf71f69d0d9710352f71dc8f48b771b9e64204c5182

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 155e98f749e9ca63bb044e5f2120f80885d63057439916b02d929effd3a13057
MD5 306e52fd3e8c5e9681bc1b8b64929abf
BLAKE2b-256 172a135cea8a0da46c30f6165fa3340c81abc11886b652102f44c74b94b4a072

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0d2b89b4f8ad72cfdb40d1052344d73a19212f4c0b552494e156c65f5005f2e6
MD5 d55294758d2e6ac9e179a78d2f57ae54
BLAKE2b-256 9ee62ab73d817c74a33d242af44322f50049e6ef87af3bf140e5e42b71148507

See more details on using hashes here.

Provenance

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