Zignal Python Bindings
Zero-dependency image processing primitives written in Zig and packaged for Python.
Feature Overview
| Area | Highlights |
|---|---|
| Images | PNG/JPEG load/save, resize & warp, crop/letterbox, insert/extract, Gaussian/median filters, motion blur |
| Pixels & Arrays | Direct indexing/assignment, slice updates, zero-copy NumPy interop both directions |
| Colors | 12 color models (Rgb/Rgba, Hsl/Hsv, Lab/Lch, Xyz/Xyb, Oklab/Oklch, Lms, Ycbcr) with automatic conversion |
| Canvas & Fonts | Lines, arcs, splines, polygons, flood fills, bitmap font text rendering |
| Geometry | Rectangle algebra, convex hulls, similarity/affine/projective transforms |
| Terminal Output | SGR, Braille, Sixel, and Kitty renderers with automatic format negotiation |
| Numerics | Matrices with rich linear algebra, PCA, optimization (Hungarian), running statistics |
All functionality is implemented in Zig with no runtime dependencies, making the wheel lightweight and easy to vendor.
Installation
pip install zignal-processing
- Python 3.10 – 3.14 (CPython)
- Prebuilt wheels ship for:
- Linux (manylinux2014)
x86_64,aarch64 - macOS
x86_64andarm64 - Windows
x86_64
- Linux (manylinux2014)
- Building from source requires Zig 0.15.0 or newer available on your
PATH.
If CPython headers/libraries are in a non-standard location, set PYTHON_INCLUDE_DIR, PYTHON_LIBS_DIR, and PYTHON_LIB_NAME before installing.
Quickstart
import numpy as np
import zignal
# Load or create an image
img = zignal.Image.load("photo.jpg") # PNG/JPEG
canvas = zignal.Image(480, 640, color=zignal.Rgb(30, 144, 255)).canvas()
# Draw & process
canvas.draw_circle((120, 160), 60, zignal.Rgba(255, 255, 255, 180), fill=True)
img = img.gaussian_blur(1.5)
img = img.resize(0.5, zignal.Interpolation.BILINEAR)
# Pixels + NumPy (shared memory views)
img[10, 20] = zignal.Hsv(60, 100, 100)
np_view = img.to_numpy() # (rows, cols, 3) uint8 view
np_view[..., 0] = np.clip(np_view[..., 0] + 32, 0, 255) # modifies img in-place
img2 = zignal.Image.from_numpy(np_view) # zero-copy back into Zig
# Streaming stats & procedural noise
stats = zignal.RunningStats()
for value in np_view.mean(axis=-1).flat:
stats.add(float(value))
noise = zignal.perlin(0.2, 0.4, amplitude=1.2, frequency=2.5, octaves=4)
print(f"μ={stats.mean:.3f} σ={stats.std_dev:.3f} perlin={noise:.3f}")
# Terminal preview (auto: kitty → sixel → sgr fallback)
print(f"{img:auto}")
# Save
img.save("out.png")
Documentation & Support
- Docs: https://arrufat.github.io/zignal/python/zignal.html
- Source: https://github.com/arrufat/zignal
- Issues: https://github.com/arrufat/zignal/issues
Development
zig build python-bindings # build extension + stubs
cd bindings/python
uv venv && uv pip install -e . # editable install
uv run pytest -q # run tests
Building Wheels
To build a wheel for your current platform:
cd bindings/python
uv run python -m build --wheel
To cross-compile or specify optimization:
ZIG_TARGET=x86_64-linux-gnu ZIG_OPTIMIZE=ReleaseFast uv run python -m build --wheel
Environment Variables
| Variable | Description | Default |
|---|---|---|
ZIG_TARGET |
Zig target triple | native |
ZIG_OPTIMIZE |
Optimization mode (Debug, ReleaseSafe, ReleaseFast, ReleaseSmall) |
ReleaseFast |
ZIG_CPU |
CPU micro-architecture (e.g., baseline, x86_64_v3) |
baseline |
For portable Linux wheels, it is recommended to run auditwheel repair on the resulting wheel. On macOS, use delocate-wheel.
Contributing Bindings
Follow the bindings guide for argument parsing helpers, enum registration, image ownership, and stub generation.
Sponsors
Special thanks to B Factory, Inc, the Founding Sponsor of Zignal. They originally developed this library and graciously transferred ownership to the community to ensure its long-term maintenance and growth.
License
MIT
Metadata
Release files for zignal-processing 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 70.6 MB
Release files / zignal_processing-0.10.0-cp314-cp314-win_amd64.whl
| Download URL | zignal_processing-0.10.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3f0bdb1881f96955526ecb6636e481499b405fecbdec87cf72d642b8c7969899
|
|
BLAKE2b-256 checksum How to use checksums |
5c7b1a12dda7a201afa7f2d420d9c724462c2d297a4b012df57f45dea46b6c7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
64230eeefcf32533602bbca02dda7c791c3be83acd8dea388f1bac84652a7305
|
|
BLAKE2b-256 checksum How to use checksums |
eed433d8ce64ec7fe8e503da6f39f66797684cdd9119898dd305ba2ab55c1903
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp314-cp314-macosx_13_0_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp314-cp314-macosx_13_0_x86_64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.14 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
e63436eb2699a8e4dd65064c52366858b848cfad7e059e1c6a7ab32a5b1988d5
|
|
BLAKE2b-256 checksum How to use checksums |
32e15b9ec18a0b83654b18f6385b8388d3b38d14a1acf310cbcf7aac326539d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp314-cp314-macosx_13_0_arm64.whl
| Download URL | zignal_processing-0.10.0-cp314-cp314-macosx_13_0_arm64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.14 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
683f9c9b0f3416618edcac32dbc8766a58c15721322ce20bc582fa2fbf457516
|
|
BLAKE2b-256 checksum How to use checksums |
e8afd3d4ee6b6c70f9c016b0a90c15e21438b13893aa521b1c184b5c72662c6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp313-cp313-win_amd64.whl
| Download URL | zignal_processing-0.10.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e635418e01eebdd55403b6a9a14638b534b33e2139b0424c90eb75a798c8be05
|
|
BLAKE2b-256 checksum How to use checksums |
642109dfe05b21e93fcd3604949f26c7021d7ec76cb28cfba7b957997e1c94c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dbe9cf3055b4553962dc10b2303eb08319e916166f93e12cc7c1c8ece487bca6
|
|
BLAKE2b-256 checksum How to use checksums |
e753bab7506339b6e7e162804edfc2011bdca12082462001fed6ef11c1e80ada
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp313-cp313-macosx_13_0_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp313-cp313-macosx_13_0_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.13 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
fe003854f20ec5aa611fd78ae1590757bdf5f0d90d89ee981d677699ff9953b9
|
|
BLAKE2b-256 checksum How to use checksums |
5980b339f942ad9aa3e5a125a4c5392329991688c5282b37f1b4851f6f761328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp313-cp313-macosx_13_0_arm64.whl
| Download URL | zignal_processing-0.10.0-cp313-cp313-macosx_13_0_arm64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.13 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9662bc6d62f9f83a107557c2f7def655e96f45e2f76b09d34014cf11d1caa7c0
|
|
BLAKE2b-256 checksum How to use checksums |
1b9bfc398f069229bc072c1ec5c36675bdb2fc026a1d19d4821c53ae93226927
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp312-cp312-win_amd64.whl
| Download URL | zignal_processing-0.10.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
032776e4b2f6cada1c8a764c03e1f8966b9c025a09e3dd9253d418c30aeac3d8
|
|
BLAKE2b-256 checksum How to use checksums |
ce90e9268b2a4a8a8a286b81c37d641f58569fc40e9cf9bd90bccfd427e4e904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cda370bd1abee3c3e905dc95f6f6202707bc5cdd41a188376b10480f257ac68a
|
|
BLAKE2b-256 checksum How to use checksums |
4737a9d84dec27c4eec1ec08b4b06c99d41cdded22c767bbf75e3092ff58783d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp312-cp312-macosx_13_0_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp312-cp312-macosx_13_0_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | CPython 3.12 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d456a1d8af754e7839d4be542773be20ddaa3c4d718d956692982ea81645f29
|
|
BLAKE2b-256 checksum How to use checksums |
2c23c7a4944bf643082d2cb056a2663120c9f18d10c431ae6b1e449f1d7e329c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp312-cp312-macosx_13_0_arm64.whl
| Download URL | zignal_processing-0.10.0-cp312-cp312-macosx_13_0_arm64.whl |
|---|---|
| Size | 6.0 MB |
| Tags | CPython 3.12 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6c954481298829dc5ed596df8b55a2ca1ebac7bdd6eb66f4d51583a45a2b5dd4
|
|
BLAKE2b-256 checksum How to use checksums |
3ecb3666c0abbe4d1dd45e7598fdc0e451ba787df8a356846e40d68541d233d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp311-cp311-win_amd64.whl
| Download URL | zignal_processing-0.10.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
64336475f64aa3ca85babdd09caa7612f7c27a0c219aa91c7d4a2620f39bef8e
|
|
BLAKE2b-256 checksum How to use checksums |
d9d0056b71eb9ff7a8e4d56537e4170a7aa3c2e825c249bce6b0836ca7bbe0ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3938beb1ad9e5b96bad71f3ecc9ebd866f7cef61cf46a3d4b827eae7f0560c0e
|
|
BLAKE2b-256 checksum How to use checksums |
61f95edcae00f8809ed631c72ddbb8f30dcbec5ac1c951c37e254b0d91a41d63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp311-cp311-macosx_13_0_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp311-cp311-macosx_13_0_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.11 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
1ca62294fff48199667883413f53e2b1ed55ee282a61f1708d66ddaf0abb4e26
|
|
BLAKE2b-256 checksum How to use checksums |
f7c4d562d2c62e56ff0e1729ce9727b52b57cf51b2a94f340f1c5b26fa7d36f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp311-cp311-macosx_13_0_arm64.whl
| Download URL | zignal_processing-0.10.0-cp311-cp311-macosx_13_0_arm64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.11 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3baa9a5fdb28ce566ac2fe51abcb4eb9e26799d363cd0546b7535da2e8c5be08
|
|
BLAKE2b-256 checksum How to use checksums |
92657cdb100eb388fb098aef11998c7832ade9424ae774970b67356d0602f804
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp310-cp310-win_amd64.whl
| Download URL | zignal_processing-0.10.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3866aba1563a376405a30b75315006f8518f5d291f3e03dfa315e3f643b555e3
|
|
BLAKE2b-256 checksum How to use checksums |
2bc47a7f1498d9acfe0aaa6557bc3db27bc33d74fb6b79687fcd3967d6af064d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ffb98ef212f5cd46ffb6d6577fe760322415e10cf7ddae9be35b55cd67af089f
|
|
BLAKE2b-256 checksum How to use checksums |
86258bdbd4de15a4d25f766b11a6575cf932b1f5bfa875edfefccec49dbae374
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp310-cp310-macosx_15_0_x86_64.whl
| Download URL | zignal_processing-0.10.0-cp310-cp310-macosx_15_0_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.10 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
5c99ab4ae688c1ce19b4bada52b2fbbc8a4b13fa7e38f92c7558473574a03318
|
|
BLAKE2b-256 checksum How to use checksums |
1b900ded3b98587137f5cc08c1216cc2a6b7ce9984d275676c8601e3b2776150
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / zignal_processing-0.10.0-cp310-cp310-macosx_13_0_arm64.whl
| Download URL | zignal_processing-0.10.0-cp310-cp310-macosx_13_0_arm64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.10 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f14d98172664ad3a3440cdff3d8f8909ea140ee8b70432322da69ab038c459a4
|
|
BLAKE2b-256 checksum How to use checksums |
51a611dae9365bc6f99034272753cd82249917848463a6e8a91c1dbbc064fe30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|