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

Uploaded Source

Built Distributions

pyrecoil-0.3.5-cp311-cp311-macosx_10_9_universal2.whl (600.7 kB view details)

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

pyrecoil-0.3.5-cp310-cp310-macosx_10_9_universal2.whl (600.7 kB view details)

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

pyrecoil-0.3.5-cp39-cp39-macosx_10_9_x86_64.whl (305.7 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.5-cp38-cp38-macosx_10_9_x86_64.whl (305.7 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.5-cp37-cp37m-macosx_10_9_x86_64.whl (305.7 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyrecoil-0.3.5.tar.gz
  • Upload date:
  • Size: 135.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for pyrecoil-0.3.5.tar.gz
Algorithm Hash digest
SHA256 72d7c1800d3b51db53aeffeff35850b29c33f70fba11d77d8cb5d93e342854aa
MD5 9eb32ae1ecea11fa69afcfd30171189b
BLAKE2b-256 bacf1531eb7a02d97954d148ed53b719c2f5578289ce2f0cc9ebb98e698a0146

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.5-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 6c5b4d44d4edd7255b41af12d58fa5ac65b6f4d1d3004bd5fecb4e9245f7b715
MD5 7b9ee7c5cac8af805e54fb50c9df220b
BLAKE2b-256 ceb1cb88950c8b86dd3da1230bfbe940e16fda60f5ef99e02a6ed968a7d867d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.5-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7c05bd613af4c10e841447cce727fda043313213bbcdba114f88f07bbf9559ef
MD5 b9aa247a0b053dcdb734b86312368a35
BLAKE2b-256 b11b192b86a3c37771c912f6342396d5b8193ea620e6f5ca5a25f077f8172b04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 629f8159eae1c24154dad42111b7e86e59d710aea7eaf4b09155e825ec80af11
MD5 385c270d7b4b49aa2b8cdfce9483974e
BLAKE2b-256 f796b70c8a1fc8b3538e5d40147767975fde5f15efe2099dd24652497b0bb8c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ed2f6182a1b300ed98c6eecdcde271c89ff41edd895c33106a422e6c3b3cac07
MD5 7fa2161a2bc4dfd1b380de4f46583b1d
BLAKE2b-256 7eeaf9158464c6bd14bf8490ba6a18196e4c522bee81b8eca9f4ba4832ac3b6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9da17fc9fd61aabdb1832e260a14b695641cd6f93b409d388c866be2bd4dac65
MD5 6e8a291c694b15cfd12f96372cd5ba6e
BLAKE2b-256 2d44759b790205420a42d5cd4f135d27afd7d3560524d45f945418591a22c101

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