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

Uploaded Source

Built Distributions

pyrecoil-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl (239.6 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl (239.6 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl (239.6 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyrecoil-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl (239.6 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pyrecoil-0.3.2-cp27-cp27m-macosx_10_6_intel.whl (462.5 kB view details)

Uploaded CPython 2.7m macOS 10.6+ intel

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2abfc367a3f59f7bdafb08b9508b6c9b18b52e6fc0fb556904c370e6fff1d27f
MD5 b45739b36b7222795ba0608251246721
BLAKE2b-256 7bf4c928c71e3bfbfaf70cbe0db4125413cebb7aac2a706fe3d59dbb3c9c212e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 239.6 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40e6e22263ec7ef23cd3d80b56e48d19e6c4ac7ca16044f93940615c5a4eda8a
MD5 8f856f3abd05ce67c11ae434b65a283f
BLAKE2b-256 d7066e6a866328ddfe062e4bc2d24f380bc62f94272935c14961d4356e64c5b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 239.6 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ab017c7ace8dce20cca91458d797d888480f657d0749c0646ed0f5b281922262
MD5 f953f4ed1f687bf713cb1e3f1eb51f61
BLAKE2b-256 fff419aef9011334d7578f5ea721383467716f6bc9cd16875f50277ee4ca4837

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 239.6 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b25a4301d8ace71daffdaa454d0322f2d7ebf1060a166a50838465b2a27e73e1
MD5 8a51e1e12ea15174d5c06f24d9766909
BLAKE2b-256 2253700cb48f62ceffb8240e1c2ca8344c7ee6d4f957cd2de9b5896157db6bfb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 239.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f1454e5d9b9ab99f40c3e2a8d751ceda78e1a12d4e8ef463c56e6de28c9e56f2
MD5 1a4824aa104dd4994b23b75bbf6a7372
BLAKE2b-256 ee9726d38571719bed6c3e9565f8d69e47e04ad7422cf9fed108ddc195ebbf9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyrecoil-0.3.2-cp27-cp27m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 462.5 kB
  • Tags: CPython 2.7m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for pyrecoil-0.3.2-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 f731fdc670c75890f937a5a9b3fdea206bc1626368728f5c03084bb121ae42f9
MD5 f993938cb4022f44ef60f4b055a84243
BLAKE2b-256 4afc9fc72b8ca310c48757ed757df2e8dcbac53e39bccf2aa2b902f03519461f

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