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

Uploaded Source

Built Distributions

pyrecoil-0.3-cp38-cp38-macosx_10_9_x86_64.whl (229.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3-cp37-cp37m-macosx_10_9_x86_64.whl (229.4 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyrecoil-0.3-cp36-cp36m-macosx_10_9_x86_64.whl (229.4 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pyrecoil-0.3-cp27-cp27m-macosx_10_6_intel.whl (444.3 kB view details)

Uploaded CPython 2.7m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pyrecoil-0.3.tar.gz
  • Upload date:
  • Size: 110.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.0

File hashes

Hashes for pyrecoil-0.3.tar.gz
Algorithm Hash digest
SHA256 504465f0f09a794141b64782a09d695c75ab03b0fe9591515e0c37a7d82cee52
MD5 9f365f55371c5577f94a63c1be7d33eb
BLAKE2b-256 a4bd4eec601ab19aef7e755d8277b261d7820a9ea9393e6592218f99f47200f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 229.4 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.0

File hashes

Hashes for pyrecoil-0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 54dfcfb17157c0a96b0b2072dff4fdab6b132c10fb3871242bc0bdddbc40b309
MD5 583301060860f253a82c60e94ca7f8f2
BLAKE2b-256 08b88dfefb69fe99364b9c9f182f8f27c0b48f3301a82b45717e3cc83cf55d9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 229.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.0

File hashes

Hashes for pyrecoil-0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2e43bbe2f4ff5f1a197224a2a729cf63a9822012012c4419a13c37a3ddb67e45
MD5 0e79d81d62e8b59b1bc994ee46c31551
BLAKE2b-256 cb86e332b31ce6b754a84c04cfba237aaab674d78663cee30a58b74d473f454a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 229.4 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.0

File hashes

Hashes for pyrecoil-0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 331e38b6f6bdec31da1fca4b4033bf31825af486c529befb25072c557c01e5f9
MD5 ac936e5edd8dbbd57a376583564c7214
BLAKE2b-256 c6f45839da6273ac4b358f6c48b2f8b92673ea0cb6a2593b43c0afb011f63332

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 444.3 kB
  • Tags: CPython 2.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.1 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.14.0 CPython/3.5.0

File hashes

Hashes for pyrecoil-0.3-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 4709ea54ae0863a41671e762d5f585fe87ef84fb3cde704a8be22b5cd34bc411
MD5 f0aa353422b6957847910e67def74a0e
BLAKE2b-256 7a2bf8b88d1f464c3b90b68a950cb138dc6e77777fe8edfe732f869a7ddb648e

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