Skip to main content

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

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrecoil-0.3.8-cp311-cp311-macosx_10_9_universal2.whl (626.8 kB view details)

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

pyrecoil-0.3.8-cp310-cp310-macosx_10_9_universal2.whl (626.8 kB view details)

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

pyrecoil-0.3.8-cp39-cp39-macosx_10_9_x86_64.whl (318.0 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyrecoil-0.3.8-cp38-cp38-macosx_10_9_x86_64.whl (318.1 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pyrecoil-0.3.8-cp37-cp37m-macosx_10_9_x86_64.whl (318.1 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyrecoil-0.3.8.tar.gz
Algorithm Hash digest
SHA256 9de66373bfa58ba127a92fbf1021ea7d9cf8565cf1ed1466ee936b67c25370ed
MD5 e57ee52ae05197a467e4420b899695c6
BLAKE2b-256 970da3a93f9888f50ec2bc86c2dd08309cc018244eb9dc3c6e1a9c060055990f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.8-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ef71151fdcb20fdc89ed6a662bc15eaeaf7356b1232d822c116aa957d1124034
MD5 b5998e2928facf2e9cb783b4771175d6
BLAKE2b-256 392fb08ebe205ee1da95588a0cdad85342bfdebd412ed20daff2abf608e6734f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.8-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 34cd72365fd6a7063a7e4355d85093d8abbb4feb26ee81d03f6b213b21cde4b4
MD5 4837c84d3687c6b8d5c6d1babd220f0a
BLAKE2b-256 b4dcdc81982cec16322fa1acc597e13f91ed850ce8191afd3bc066c791ce3b34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b5f814395185888e5e85dc735063fdd0304f25c3dbfb98884b6cc46249d5db6
MD5 017f144d62129d520b2203504a07c2a5
BLAKE2b-256 0fcf37555bd561b2318821e6ec0ce23015a7b6a7c8fedab8da7742b78f7a23e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 489be2509817ed778510b9dba62f9d3c91b5b898e296c37520ba6fd02d021595
MD5 661045989ff993e9e4c12a9f96d48acc
BLAKE2b-256 82fb9612320716056bed2a111c4968d14d0d4fdf20ba1ad8654e59f85a1a0041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b3bd186d5a62852f71fc07f5807984a5f74783dd13c76b2e4ff5b992f479769
MD5 0887ce24499e22869bf63b00414c8852
BLAKE2b-256 82f26c60b0b40d9300f66f84abb0fe218e78720e882f8153f571e233d5672b83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page