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

Uploaded Source

Built Distributions

pyrecoil-0.3.1-cp38-cp38-macosx_10_9_x86_64.whl (237.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl (237.5 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyrecoil-0.3.1-cp36-cp36m-macosx_10_9_x86_64.whl (237.5 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pyrecoil-0.3.1-cp27-none-macosx_10_6_intel.whl (453.1 kB view details)

Uploaded CPython 2.7 macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pyrecoil-0.3.1.tar.gz
  • Upload date:
  • Size: 114.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.2

File hashes

Hashes for pyrecoil-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f39b7446ac4c51747fee85edb36ef6be73da087ec29967aada09aab995654da4
MD5 a577c747ed74ea164d0e046893ec6a64
BLAKE2b-256 9c301c36248cc9eadc27e3ad11bbce20e6217a8047551b090f5615463c8a2229

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 237.5 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.2

File hashes

Hashes for pyrecoil-0.3.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9f1ea52fdcec0bb283f806a6deba25f2c90ce5633494e0560ee8f90be7576ae5
MD5 5d960eeea151694b9f22dfd0507def93
BLAKE2b-256 b6a324eb4b0398a412fa82042a9fd6e60c9a45d45b94f89d85d25626ee34a36a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 237.5 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.2

File hashes

Hashes for pyrecoil-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9bb6e0b2df908a897a3e2f5e9a34116a3657b82112bd001ffd633d8959535a38
MD5 7f3d9c1972345ee34e961c2481fd47f0
BLAKE2b-256 1b85c8478d3c8e00c63a119f1dfbe029c43485aa82648f3a788a98f9f0ff33b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 237.5 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.2

File hashes

Hashes for pyrecoil-0.3.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c91c411d7d185bffbad7f1d324840d31c301f0dfb2e740c9159e82662b3683d7
MD5 c10febd6277387ea647d435f9ac21ffd
BLAKE2b-256 2c5ed40f2fa4b1929c949f91bc7af0854f777102952428c425d2b5ce488fd997

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.1-cp27-none-macosx_10_6_intel.whl.

File metadata

  • Download URL: pyrecoil-0.3.1-cp27-none-macosx_10_6_intel.whl
  • Upload date:
  • Size: 453.1 kB
  • Tags: CPython 2.7, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.2

File hashes

Hashes for pyrecoil-0.3.1-cp27-none-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 aa439ae9862631471c98fcae6feec244ddbee167579ec90858cb85c7c41f555f
MD5 9a9580dd05988fa16cb45d971dd062e9
BLAKE2b-256 de0a90d6c8c88a0d7a7816a93b8f2d69231371ddc405f1864a2dca1b01c5ef99

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