PyO3-powered image transform for Pixel-convert (Rust core)
Project description
pixel_convert (Python package)
This package exposes a Python API backed by the Rust pixel_convert_rust core via PyO3.
API
pixel_convert.transform(image: PIL.Image.Image, width: int, height: int, kmax: int, *, fast=False, stride=None, stride_x=None, stride_y=None, alpha=None, epsilon_palette=None, t_final=None, stag_eps=None, stag_limit=None, threads=None, iter_timings=False) -> PIL.Image.Imagepixel_convert.transform_file(input_path: str, output_path: str, width: int, height: int, kmax: int, *, fast=False, stride=None, stride_x=None, stride_y=None, alpha=None, epsilon_palette=None, t_final=None, stag_eps=None, stag_limit=None, threads=None, iter_timings=False) -> None
Build from source
pip install maturinmaturin build -m pixel_convert/Cargo.toml --releasepip install target/wheels/*.whl
Develop install for local testing
maturin develop -m pixel_convert/Cargo.toml
Example
from PIL import Image
import pixel_convert as rx
img = Image.open("examples/input_images/dog3.jpg")
out = rx.transform(img, 128, 128, 30, fast=True)
out.save("examples/output_images/dog3_py_128x128_30.png")
File-to-file example (faster, Rust handles I/O)
import pixel_convert as rx
rx.transform_file(
"examples/input_images/dog3.jpg",
"examples/output_images/dog3_py_128x128_30.png",
128,
128,
30,
fast=True,
threads=4,
)
Timing per iteration (logs)
import pixel_convert as rx, os
os.environ["RUST_LOG"] = "info"
rx.transform_file("examples/input_images/dog3.jpg", "examples/output_images/dog3_py_128x128_30.png", 128, 128, 30, iter_timings=True)
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
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 pixel_convert-0.1.0.tar.gz.
File metadata
- Download URL: pixel_convert-0.1.0.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2753888a3205ef1fb75375f5b35c483c9534fa63e4f9ae66ba5ca9de8dc45cec
|
|
| MD5 |
ddfd7711bf5e318a99290af1c99c509a
|
|
| BLAKE2b-256 |
1653ae13fadfbb2b45f7eb0e8f7b85cb4a7aff4542090a91061ad6a5f62700f1
|
Provenance
The following attestation bundles were made for pixel_convert-0.1.0.tar.gz:
Publisher:
wheels.yml on QAM/pixel-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixel_convert-0.1.0.tar.gz -
Subject digest:
2753888a3205ef1fb75375f5b35c483c9534fa63e4f9ae66ba5ca9de8dc45cec - Sigstore transparency entry: 724671765
- Sigstore integration time:
-
Permalink:
QAM/pixel-convert@538cd0babab973710b6f17128106f60d2d98f46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QAM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@538cd0babab973710b6f17128106f60d2d98f46f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pixel_convert-0.1.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: pixel_convert-0.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b62eac645c3fa0a75b29b403adeb4e5eda6a34af623177c1ceedfbb3262d606
|
|
| MD5 |
fd003c64614f329caaf9e448130818ab
|
|
| BLAKE2b-256 |
ab50c390619aceb28efdb3bed28e645814e080db4e3eeba9fc7328e51937cde2
|
Provenance
The following attestation bundles were made for pixel_convert-0.1.0-cp39-abi3-win_amd64.whl:
Publisher:
wheels.yml on QAM/pixel-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixel_convert-0.1.0-cp39-abi3-win_amd64.whl -
Subject digest:
1b62eac645c3fa0a75b29b403adeb4e5eda6a34af623177c1ceedfbb3262d606 - Sigstore transparency entry: 724671773
- Sigstore integration time:
-
Permalink:
QAM/pixel-convert@538cd0babab973710b6f17128106f60d2d98f46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QAM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@538cd0babab973710b6f17128106f60d2d98f46f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pixel_convert-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pixel_convert-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
687229c8f5050e32a3f214d0093033a0bcc078a5eb351d0fce29390b8064f48f
|
|
| MD5 |
de2d92656693be4272d818fb93a049d9
|
|
| BLAKE2b-256 |
a8cdafdc50ee3e8deae281e24eecffc0d935f0590b3b8fb24200e420ebfe1414
|
Provenance
The following attestation bundles were made for pixel_convert-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
wheels.yml on QAM/pixel-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixel_convert-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
687229c8f5050e32a3f214d0093033a0bcc078a5eb351d0fce29390b8064f48f - Sigstore transparency entry: 724671771
- Sigstore integration time:
-
Permalink:
QAM/pixel-convert@538cd0babab973710b6f17128106f60d2d98f46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QAM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@538cd0babab973710b6f17128106f60d2d98f46f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pixel_convert-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pixel_convert-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c68776b6444603e04e38665b03c26dae23ec1ba20359ef721ea137a9d747915
|
|
| MD5 |
1458127aa541d45a76b9a74a64e26999
|
|
| BLAKE2b-256 |
9d5b766ad6c4d3d63562fcaef5a0d77b239978359dc9800c7dbcbd41efaaa355
|
Provenance
The following attestation bundles were made for pixel_convert-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on QAM/pixel-convert
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixel_convert-0.1.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
3c68776b6444603e04e38665b03c26dae23ec1ba20359ef721ea137a9d747915 - Sigstore transparency entry: 724671768
- Sigstore integration time:
-
Permalink:
QAM/pixel-convert@538cd0babab973710b6f17128106f60d2d98f46f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QAM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@538cd0babab973710b6f17128106f60d2d98f46f -
Trigger Event:
push
-
Statement type: