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 400 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.3.tar.gz (121.1 kB view details)

Uploaded Source

Built Distributions

pyrecoil-0.3.3-cp310-cp310-macosx_10_9_universal2.whl (268.4 kB view details)

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

pyrecoil-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl (268.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.3-cp38-cp38-macosx_10_9_x86_64.whl (268.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.3-cp37-cp37m-macosx_10_9_x86_64.whl (268.4 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyrecoil-0.3.3-cp36-cp36m-macosx_10_9_x86_64.whl (268.4 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pyrecoil-0.3.3-cp27-cp27m-macosx_10_6_intel.whl (513.1 kB view details)

Uploaded CPython 2.7m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pyrecoil-0.3.3.tar.gz
  • Upload date:
  • Size: 121.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3.tar.gz
Algorithm Hash digest
SHA256 151dc3a49c436f6b8c82b1aa7209f17ab4c9cdae8265ee4ed74e987542e96197
MD5 5219eba983099fb67d79977b9d45daa6
BLAKE2b-256 09760cd459f6233ff63ef9c129b28a063f7198d0b3a6e19c45a5500dc8f1c59f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyrecoil-0.3.3-cp310-cp310-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 268.4 kB
  • Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b9880f7f7134a5c04b2dab8260d268a6e87d3b6d00139598ae13b5ce0ca266f5
MD5 af125c4ee8307eb23497561c3b9c5c91
BLAKE2b-256 5132e451690d2279d52a959172ed10537f98551051983dab348b712a6605077e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyrecoil-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 268.4 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 62e8f639b3f15043ec31bdfd9295a41833107852353c1e66a9cb6cb4e9d07bcd
MD5 a088b26a66a7ccfd29d082d2b6c36398
BLAKE2b-256 25a0eb975dff09974c48d90381d7a5c0036bc175435f7c47fd2a30a5d84c78dc

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyrecoil-0.3.3-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 268.4 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e7b2964c83cbd0063e9439a72f65f935eef6ede79170ff998046d5a94d4d9daf
MD5 4c434ab266fe589ca1ab15d43f93f3f7
BLAKE2b-256 3c94332e69d5b5680b6cd9b717367d179f09e1031d180db0158003444b83d973

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: pyrecoil-0.3.3-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 268.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eea3ef65c03f886248d3204c970fff12918aa6882d26b6575ccb416ecf3d2261
MD5 dff3391f863f97c1172e9144b4a47d03
BLAKE2b-256 1819fdc4d96f5106d4ff42fd28c45b3d007c578a748abf22882c3c343c84cb73

See more details on using hashes here.

Provenance

File details

Details for the file pyrecoil-0.3.3-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pyrecoil-0.3.3-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 268.4 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cfdae342a6931762607e8e7648b205e2a70084edbc6123dcfae263d76b6d6fdc
MD5 08ebbc49989f4cbadd0f630d0362778f
BLAKE2b-256 0c41fafa03a363dfc572373637e7484ed0dfc17764b91891e5ed24c4380ab8f8

See more details on using hashes here.

Provenance

File details

Details for the file pyrecoil-0.3.3-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

  • Download URL: pyrecoil-0.3.3-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 513.1 kB
  • Tags: CPython 2.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.3-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 e6f9676f7c7c83f988fef76d356d7fa9de3cc99324ec051b3944f7e595b3b49c
MD5 905f0ee0432817a699f5edbfe88e1973
BLAKE2b-256 1badff8037d7196cc07993ef040488b8123150a30dcdad1b524b88b8fd4f489a

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