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

Uploaded Source

Built Distributions

pyrecoil-0.3.6-cp311-cp311-macosx_10_9_universal2.whl (599.3 kB view details)

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

pyrecoil-0.3.6-cp310-cp310-macosx_10_9_universal2.whl (599.3 kB view details)

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

pyrecoil-0.3.6-cp39-cp39-macosx_10_9_x86_64.whl (304.3 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrecoil-0.3.6-cp38-cp38-macosx_10_9_x86_64.whl (304.3 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrecoil-0.3.6-cp37-cp37m-macosx_10_9_x86_64.whl (304.3 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyrecoil-0.3.6.tar.gz
  • Upload date:
  • Size: 136.4 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.6.tar.gz
Algorithm Hash digest
SHA256 7e13e840f5f87b07313e4db562f3177f0b9bab563990a45492699cd7c571e11a
MD5 a75d70015833288f6c4491c7046de383
BLAKE2b-256 425b56aa5966f2e1538f02e7c50ffb63e0d7faf60fa5dcd2ee376ef5bc1b4fb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.6-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 e65a2d9f06ae60f3385873a3a2d884bcc8baafeef9d0524ab885aa3aee15c078
MD5 52c4445d07144f88427fc3cbdfd1982a
BLAKE2b-256 6747e7e2fcc11adf5bc50bfc24fef460ca6cdb7bdb97d188d64cb794d2a78b31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.6-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b3e7d6bac4df17879456fe0dce9c4d337fd0fad9c197d66501f769f6f68414f7
MD5 78d84769b747ae25c76ca14f77b24867
BLAKE2b-256 e860b5d6be2e2a7908ceacc45c081a0503aca474dff46481339c1f439c753616

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b649b7dab62e890413699a010e0b02e285f3a1af4871aa3863844b2a77d07418
MD5 8e5e3d391d95cf88d9dd6d8d7ec65951
BLAKE2b-256 8d628c552fac47c10e926c11024b0f3b34cc9a94146ce8ee780112a0f5bd6b32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6373cb87cefb7ff9d1b28937f46e2575d56402159b6aa8c2b9d78d06dd27ca05
MD5 f6e413b3e2c8dcd64d0f461402b0d97d
BLAKE2b-256 e8dc635216bc3a0255276d7e46c81bf27ffb0970d3aa84e283f25cb7c2581529

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1a2c4359e28028ff13f8628327fbf5f7ce07ba7d59d79ec72bc303626cac31e2
MD5 1ed606b21dfd577009e773cc833a0e60
BLAKE2b-256 39bd98221fd1e49fa9a64f29b37ea3ddc11890ef44fb171d67bb466e70616f8e

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