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.1.tar.gz
(7.0 kB
view hashes)
Built Distributions
pymtpng-1.0.1-cp39-cp39-win_amd64.whl
(259.5 kB
view hashes)
Close
Hashes for pymtpng-1.0.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aad4783ec2af0c48aa44380d924650a80ed93b814095a31499ae1ca86a25c818 |
|
MD5 | 2ef74cd0eca5052d50da71595d8ced9d |
|
BLAKE2b-256 | ecdd6575d33947d795ad62c8e465cf4985b987cbe092fbde8009d95f2780d617 |
Close
Hashes for pymtpng-1.0.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6bd6f789ad17461f2f374103620404d62b41e849e6d3acfe725b48ddc9126c |
|
MD5 | cead5f27cc5e2615a4dede058645cc3d |
|
BLAKE2b-256 | 75fa22c819952e21b579f08dd7579fdab60dd4aeb912f169fa4c25c7d3e56ede |
Close
Hashes for pymtpng-1.0.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cef97264bfa1c87e2083b59fae75fe95f45ba3a4f3eaf13fca9c0922c9f4dd2d |
|
MD5 | a22d42021a21387a466932604753f876 |
|
BLAKE2b-256 | 3ace0dad86dc115281f53ba7dafb99ea1c706ab3c050fa58a46dd3064fb6b2c2 |