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 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.
Project details
Release history Release notifications | RSS feed
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.tar.gz
(110.1 kB
view hashes)
Built Distributions
Close
Hashes for pyrecoil-0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54dfcfb17157c0a96b0b2072dff4fdab6b132c10fb3871242bc0bdddbc40b309 |
|
MD5 | 583301060860f253a82c60e94ca7f8f2 |
|
BLAKE2b-256 | 08b88dfefb69fe99364b9c9f182f8f27c0b48f3301a82b45717e3cc83cf55d9e |
Close
Hashes for pyrecoil-0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e43bbe2f4ff5f1a197224a2a729cf63a9822012012c4419a13c37a3ddb67e45 |
|
MD5 | 0e79d81d62e8b59b1bc994ee46c31551 |
|
BLAKE2b-256 | cb86e332b31ce6b754a84c04cfba237aaab674d78663cee30a58b74d473f454a |
Close
Hashes for pyrecoil-0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 331e38b6f6bdec31da1fca4b4033bf31825af486c529befb25072c557c01e5f9 |
|
MD5 | ac936e5edd8dbbd57a376583564c7214 |
|
BLAKE2b-256 | c6f45839da6273ac4b358f6c48b2f8b92673ea0cb6a2593b43c0afb011f63332 |
Close
Hashes for pyrecoil-0.3-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4709ea54ae0863a41671e762d5f585fe87ef84fb3cde704a8be22b5cd34bc411 |
|
MD5 | f0aa353422b6957847910e67def74a0e |
|
BLAKE2b-256 | 7a2bf8b88d1f464c3b90b68a950cb138dc6e77777fe8edfe732f869a7ddb648e |