Python bindings for MTPNG library
Project description
Python mtpng
Python bindings for the MTPNG library, a parallelized PNG encoder in Rust by Brion Vibber.
Usage
import pymtpng
...
# Encode numpy uint8 array to PNG
with open("image_uint8.png", "wb") as fh:
pymtpng.encode_png(image_uint8, fh)
...
# Encode numpy uint16 array to PNG
with open("image_uint16.png", "wb") as fh:
pymtpng.encode_png(image_uint16, fh)
...
# Customize encoding options
pymtpng.encode_png(
image, fh,
filter=pymtpng.Filter.Adaptive,
compression_level=pymtpng.CompressionLevel.Fast,
strategy=pymtpng.Strategy.Huffman,
)
...
# Store key-value pairs as iTXt chunks
pymtpng.encode_png(image, fh, info={"Hello": "World"})
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
pymtpng-1.0.tar.gz
(6.9 kB
view hashes)
Built Distributions
pymtpng-1.0-cp311-cp311-win_amd64.whl
(260.4 kB
view hashes)
pymtpng-1.0-cp310-cp310-win_amd64.whl
(260.5 kB
view hashes)
pymtpng-1.0-cp39-cp39-win_amd64.whl
(259.5 kB
view hashes)
Close
Hashes for pymtpng-1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b7396885235497f712624114245e64488a902afd5d40e0ae093ec1ce7aaa401 |
|
MD5 | ef1b1b470d20db592540831ce5419b32 |
|
BLAKE2b-256 | 54176c098b93a64993796c7583239a6a01b3e78dd9fdc3e019d20289b4254acc |
Close
Hashes for pymtpng-1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afe6b92df08f73f124afe45058ec19b03980e51e22359306f5821041f2eb16e7 |
|
MD5 | 1daf1f5912ce9312a478950d384043eb |
|
BLAKE2b-256 | adf2bd6d0737636e5647d00d3bba3212bfedea65b9acbae2415d1df9a894a584 |
Close
Hashes for pymtpng-1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca781f48382969d4d94895f36ec9a0301e214b8064dfab54468ae754c41c31b3 |
|
MD5 | c34f8d4f6b99fa1738133ea3492d5ba3 |
|
BLAKE2b-256 | 914e736244855805e94555f3bc9d7fab1ac4c258bfbc6d78b3dc099c95463b81 |