Skip to main content

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

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.4.tar.gz (125.1 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.4-cp310-cp310-macosx_10_9_universal2.whl (559.9 kB view details)

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

pyrecoil-0.3.4-cp39-cp39-macosx_10_9_x86_64.whl (284.0 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyrecoil-0.3.4-cp38-cp38-macosx_10_9_x86_64.whl (284.0 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pyrecoil-0.3.4-cp37-cp37m-macosx_10_9_x86_64.whl (284.0 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyrecoil-0.3.4.tar.gz
Algorithm Hash digest
SHA256 6e59672137b0b31d96d5bc4c131557738fb840c72425954496e52e60fdf057c2
MD5 57f90b69ae8fc96500bcf829d057f4f1
BLAKE2b-256 a43f7ec96dd0d62dcf944958f7845eddb032b85eec7509251adc08b1dae811dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b56614a522d1d49057e1abf0d16d36c2730435c46aba6d3226fa0199d476ca93
MD5 d2d9512827c02f96a1365246b45b9e1a
BLAKE2b-256 ca6b31c5969a2331b116857335fa26609d06d55ef384bcdb92958b2fdd31dddb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5aa0f56c07b0993113a468f66462504bbe637ab99449bf3ac1a5e92e217b2447
MD5 20a6c9c3bd4b4a13fb9fff69fb198de0
BLAKE2b-256 5df920c4e1bb3abbd3254be9ab6998b24191aa73c5e83a766cd4ffe384defba5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dfa0aec6d723acef9ea0a39518b86c2268dc6bab22ee51d553a3f857134eafa5
MD5 7f320e7da42fa731286c86476722dd33
BLAKE2b-256 8a2aa71569e9aa17cb6a259703435e2c38c0c1c7b0f35f219c82986604718f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyrecoil-0.3.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e00fd2b20dc054287dad63376089a9402f143fb7570029b34de37a732c0baff5
MD5 3969616fac422c6af11ca6a1ca37988b
BLAKE2b-256 bf40bc2d536242bbe4cf68296c896f83d5ef7ac467b5787a6ac05216237d4a79

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