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 Fusion Programming Language. For ease of distribution, the generated C output (recoil.c and recoil.h) from the fut 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.10.tar.gz (141.0 kB view details)

Uploaded Source

Built Distributions

pyrecoil-0.3.10-cp312-cp312-macosx_10_9_universal2.whl (568.4 kB view details)

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

pyrecoil-0.3.10-cp311-cp311-macosx_10_9_universal2.whl (568.4 kB view details)

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

pyrecoil-0.3.10-cp310-cp310-macosx_10_9_universal2.whl (568.4 kB view details)

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

pyrecoil-0.3.10-cp39-cp39-macosx_10_9_x86_64.whl (299.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.10-cp38-cp38-macosx_10_9_x86_64.whl (299.9 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.10-cp37-cp37m-macosx_10_9_x86_64.whl (299.9 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyrecoil-0.3.10.tar.gz
  • Upload date:
  • Size: 141.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.4

File hashes

Hashes for pyrecoil-0.3.10.tar.gz
Algorithm Hash digest
SHA256 a5ceed2bb9490e2ffacf5907bf00eaf26cde337d47f79133fc9efbbf7119cb5b
MD5 01075d06a962a6a522678c53ba955501
BLAKE2b-256 50cd6ebd6df1baa59c9f97910a5f8f5b40c130b191fc246077cd73b940d9896f

See more details on using hashes here.

File details

Details for the file pyrecoil-0.3.10-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ad69b67653604d425a85f836291f0c48a3fc694a29227bd038b5abc0dbbec384
MD5 b6011ff428ff2b6f6f61c6e934b0e13a
BLAKE2b-256 0fd1467698d532494fa5edfce950022986b63485aee83cee86a87f0c826a6f73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 de5061f79976010ff48c17e31252271138eb1cba71beb81b61933ba1219ce745
MD5 e2c271fa937392db64cfed98aea4b194
BLAKE2b-256 5614c94a019f96ff60af65b1097a86ee0b5b14d379e31f4dde61a55457fe81a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ac3af64c413d7b736ef75a0c03318c94e40b57f9a0ccb62aa5d13ff89eb9a386
MD5 eb7207953189f6da59276b239cf21c1b
BLAKE2b-256 735623f1ae61dbe09fb7e501acb0e00462a62180d1b504ba1c10ab2f526ae835

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c5c599145e11135ec83406eaa46e5da2434d26c058379c738c45fd295d156994
MD5 055aa03f00ab16ffd28863c11a89accf
BLAKE2b-256 378060049fc9a5f15c46390e3393994b58fe3785303504a07bf03359db813527

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 313df1ddbde9ec46001b151b79b55ff995eb87e831e291ea89de8d93b959be27
MD5 7d26c77d597c7adb9cf68f5a503d2ca6
BLAKE2b-256 069b7142e4dd411f0cc318e498efbd360336557217a778007114ecbbb6d42279

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.10-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3ed6d85de91a28a9459ef85cd1d427126b5bf4afa212087e8b955295477c44e
MD5 302b262c528263bebda9949aacdbf412
BLAKE2b-256 53067e06bd5002162f3152d58c9857dee0c0523475a4b92e8cd36a5898dd4051

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