Python bindings for MTPNG library
Project description
Python pymtpng
Python bindings for the MTPNG library, a parallelized PNG encoder in Rust by Brion Vibber.
Build prerequisites
- Python
3.12+ - Rust toolchain (
cargo) - CMake
>=3.24 - Ninja
- C++20 compiler
Build with dependencies from lockfile
uv sync --no-install-project
uv build --wheel --no-build-isolation
Develop with auto rebuild
uv sync
uv run ruff check .
uv run pytest
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_u16_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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymtpng-1.1.0.tar.gz.
File metadata
- Download URL: pymtpng-1.1.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e019222e2eedd97bb7f4ce8d3377ca4769a72815932a4861e541bed3d9ddb239
|
|
| MD5 |
19f5f70cfef3456f8cdd32d64d6aa5b2
|
|
| BLAKE2b-256 |
2afeee866f4a0886f84ea1129fdc816ca3720e4bf31fba693fe38d28d7087217
|
Provenance
The following attestation bundles were made for pymtpng-1.1.0.tar.gz:
Publisher:
pypi-packages.yml on pwuertz/pymtpng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymtpng-1.1.0.tar.gz -
Subject digest:
e019222e2eedd97bb7f4ce8d3377ca4769a72815932a4861e541bed3d9ddb239 - Sigstore transparency entry: 2255858869
- Sigstore integration time:
-
Permalink:
pwuertz/pymtpng@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/pwuertz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-packages.yml@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymtpng-1.1.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: pymtpng-1.1.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 220.9 kB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43fd96e68d130f1a0af94ee5fe186472696386c57ebf230c0473b2f9118159dd
|
|
| MD5 |
be28b3c5faf11cf62a746dcceaf49969
|
|
| BLAKE2b-256 |
8bb0467884bcfbd559237699df095e1e0acc66a46ab1be5e3fa44463e72a65e0
|
Provenance
The following attestation bundles were made for pymtpng-1.1.0-cp312-abi3-win_amd64.whl:
Publisher:
pypi-packages.yml on pwuertz/pymtpng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymtpng-1.1.0-cp312-abi3-win_amd64.whl -
Subject digest:
43fd96e68d130f1a0af94ee5fe186472696386c57ebf230c0473b2f9118159dd - Sigstore transparency entry: 2255858886
- Sigstore integration time:
-
Permalink:
pwuertz/pymtpng@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/pwuertz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-packages.yml@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymtpng-1.1.0-cp312-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: pymtpng-1.1.0-cp312-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 636.2 kB
- Tags: CPython 3.12+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b47747483a44b3091ba8fdf3ddcbeab9cf3931f0be1d28131cb2b0210c2c92
|
|
| MD5 |
858d91320eff83abe0b858e398e29e2b
|
|
| BLAKE2b-256 |
99ae1b8155695bd14c8b89ed260130842d0a5594efa4083109d5096e4caa64ef
|
Provenance
The following attestation bundles were made for pymtpng-1.1.0-cp312-abi3-manylinux_2_34_x86_64.whl:
Publisher:
pypi-packages.yml on pwuertz/pymtpng
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymtpng-1.1.0-cp312-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
73b47747483a44b3091ba8fdf3ddcbeab9cf3931f0be1d28131cb2b0210c2c92 - Sigstore transparency entry: 2255858902
- Sigstore integration time:
-
Permalink:
pwuertz/pymtpng@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/pwuertz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-packages.yml@9bd5f50d61b19c68363df5c4cf424e181ea5cf64 -
Trigger Event:
push
-
Statement type: