Skip to main content

Zero-dependency image processing library

Project description

Zignal Python Bindings

PyPI version Python versions Downloads License: MIT

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_64 and arm64
    • Windows x86_64
  • 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

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

Contributing Bindings

Follow the bindings guide for argument parsing helpers, enum registration, image ownership, and stub generation.

License

MIT

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

zignal_processing-0.9.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zignal_processing-0.9.1-cp314-cp314-win_amd64.whl (833.2 kB view details)

Uploaded CPython 3.14Windows x86-64

zignal_processing-0.9.1-cp314-cp314-manylinux1_x86_64.whl (797.2 kB view details)

Uploaded CPython 3.14

zignal_processing-0.9.1-cp314-cp314-macosx_11_0_arm64.whl (700.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

zignal_processing-0.9.1-cp314-cp314-macosx_10_9_x86_64.whl (780.5 kB view details)

Uploaded CPython 3.14macOS 10.9+ x86-64

zignal_processing-0.9.1-cp313-cp313-win_amd64.whl (812.4 kB view details)

Uploaded CPython 3.13Windows x86-64

zignal_processing-0.9.1-cp313-cp313-manylinux1_x86_64.whl (796.7 kB view details)

Uploaded CPython 3.13

zignal_processing-0.9.1-cp313-cp313-macosx_11_0_arm64.whl (700.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

zignal_processing-0.9.1-cp313-cp313-macosx_10_9_x86_64.whl (780.4 kB view details)

Uploaded CPython 3.13macOS 10.9+ x86-64

zignal_processing-0.9.1-cp312-cp312-win_amd64.whl (812.4 kB view details)

Uploaded CPython 3.12Windows x86-64

zignal_processing-0.9.1-cp312-cp312-manylinux1_x86_64.whl (796.7 kB view details)

Uploaded CPython 3.12

zignal_processing-0.9.1-cp312-cp312-macosx_11_0_arm64.whl (700.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

zignal_processing-0.9.1-cp312-cp312-macosx_10_9_x86_64.whl (780.3 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

zignal_processing-0.9.1-cp311-cp311-win_amd64.whl (812.9 kB view details)

Uploaded CPython 3.11Windows x86-64

zignal_processing-0.9.1-cp311-cp311-manylinux1_x86_64.whl (796.4 kB view details)

Uploaded CPython 3.11

zignal_processing-0.9.1-cp311-cp311-macosx_11_0_arm64.whl (700.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

zignal_processing-0.9.1-cp311-cp311-macosx_10_9_x86_64.whl (779.9 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

zignal_processing-0.9.1-cp310-cp310-win_amd64.whl (812.9 kB view details)

Uploaded CPython 3.10Windows x86-64

zignal_processing-0.9.1-cp310-cp310-manylinux1_x86_64.whl (796.4 kB view details)

Uploaded CPython 3.10

zignal_processing-0.9.1-cp310-cp310-macosx_11_0_arm64.whl (700.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

zignal_processing-0.9.1-cp310-cp310-macosx_10_9_x86_64.whl (779.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

Details for the file zignal_processing-0.9.1.tar.gz.

File metadata

  • Download URL: zignal_processing-0.9.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zignal_processing-0.9.1.tar.gz
Algorithm Hash digest
SHA256 dc83086f7fb03dd7f71ef99e4fdc4e155aa03bf6b8f0d404847f9639b7a2befb
MD5 16a54aa1551f746d5dc3d56149cfb804
BLAKE2b-256 4c56fbf7caa310421669770302e19181ab1ffa05881c57a25a50827214a06c11

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f91dd5364aa57394f44b79562a9697b4478516a5c7abc085e2962525ab9ddc07
MD5 81db9e6c4227c338d02620fb2cba2a79
BLAKE2b-256 a6559111101acca8857d0f4dc19991b0d14b7fcc70f36e1047369f8426b8b836

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp314-cp314-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp314-cp314-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f11ec71bb239d431910467f3127716da5c2765932954340e3f235fc3c3600fca
MD5 16881f254ed4f2d1ec4d3049c90c5675
BLAKE2b-256 382f58ea7f18597c31bf6e017452c9493e76d2cc2d9810f3e5dbd82e1f7829c8

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8345455bceffe3d97854a7a312427489859fdfaf2e32d3fff2b4cf15183e445
MD5 a66833cd4a76f1a72fb27c6d9a81f274
BLAKE2b-256 11d11ad6e90f41469221fa96300579d64ed7077bbd52b2671bea91d78e032dc8

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp314-cp314-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp314-cp314-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3f4f17ca0ace2de5b145a74f2d0b96dd6fc3b7a2160c327019e895990f2348dd
MD5 efa6e6fbdd02e589bf956da3370fa087
BLAKE2b-256 1eca1785d7ca7a017b4717fb2d948f74299d2a58ac3336575a64584babf69676

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 09446a4f57110c8e6edc973f1b1000ca6a3c611b2e35e296d16572ca89122fae
MD5 56e6cd1557196b1ce575e3ce9ec48536
BLAKE2b-256 4774ef1b97286f238c676f8b11b66997ee0da4664a55fe4f79136a7b83eff785

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1973da88fd68732f053a04abfacf9100bb12962695f3d9df5ca6c1250769c6aa
MD5 47db37f1e6b75e436a38260159b67784
BLAKE2b-256 f7b59be31476434e2e2482a000da138ce08757de58c4bd63605fbed88bb17026

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dfb94b4be5f482065288316378294278d2906ad5ff52841ecf71f54a09c18d17
MD5 f30e2faa70e8da5592b743dce1d1720b
BLAKE2b-256 72055b43efb98325712896c56fc006914559d8a6e914b002359c1909b4293183

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp313-cp313-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp313-cp313-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0814ddbf9ebcbb0cb4d761a6aa626d1d24ed94ec78859c74f7081e98046be0e9
MD5 3aa0b7e1522cd71ac3e36bd448e74f82
BLAKE2b-256 cab34e84b4db1dba4a068394ec818a2a036090523ba9ec578c57ad697d6a3e8a

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5b611f57efd0d42271a12367b4a0baef80c460159d44a132d5588943d065dc96
MD5 29cba135c18c0f3ac76164fd3838c5dd
BLAKE2b-256 4341522825d5ccf2d561dac218eb2c99e3dc49ed101715168dcce7ff9d287dd3

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 495fed30dff5b03e22f75834645edf9f82e469fc0b5ca9a78a3496b7de65daa9
MD5 9a2615043dab3441cb7466b5f9ef28d1
BLAKE2b-256 3a46847340359372f6cdc8b6c809fbacfbe59debe3fb8a7bcfe4dd82154b210f

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d654dfa51db0ce19901c17e06b22c399f4528b523870d109d82159f26208693d
MD5 1b42341961be8d05160e9ade9ea4aad3
BLAKE2b-256 f98f0c8841e3a94770d8ff1059e63f5687e516d80ba75eb4486d04cacce1ba38

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9d6e122ca79095d43283be0ff62d78ac785f671f40609b2b8710b9cc2fc0b2b3
MD5 f8e3fb89816bcd14cb80b2834119ac71
BLAKE2b-256 2b93f513d4c6bb283a8c10ded2f90c8af60dc22428074d2c2fa9c43773f1637e

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 222e68a088dc2d53d6ec0765bd6da71c07fad1d16d1381feec681266e9e41a62
MD5 cbd272ab9d78618cd6bc3478f7deb323
BLAKE2b-256 abce2d79696564dcd1d6d32b37dd46e9fc75083fb8bc28572149d88d48ff6e7d

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fed7f1cdcb975363a97360c8eabb2fa6a22c981f297fd8aa299225a34e669062
MD5 b2c38364f0f89c98efe250344ace6dd9
BLAKE2b-256 135c347993d8b6f2dfa19c65ca22cb2b39cd2513b18b9da5247cb8e606223375

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2de5ccb4ad0067f5dafeede25734d6bb644bc16cac963b54937b0801296a016
MD5 d216423febb60a96502f714fe74d0a03
BLAKE2b-256 fd7ef14066604babbf2851b3e550effffd14912979b9da5d2ead556f20216d33

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dd0d68979829efb09b02b39036da2bc345ed7f1ac9342614c1df6309ba41bca6
MD5 d2f7164afb00fdb30a49bd08b9066d20
BLAKE2b-256 293cf2c224c973beec2111ae0b47cfcf8dc910347079779b96dee584290b4c72

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 82c624451e0afa6cb70601689164970195d0e71212b69bb71deec0d477fe7c15
MD5 a5fca14074808c002373a608e722529a
BLAKE2b-256 0a22adb65efb10cf0dc37c656d9e5ab7cbd169828c76a1d75c31ea7ac9a2819e

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 845d6f204e47afecc8bc889b9adb40f1ba948ce8834f196b894e09f9e80e6b47
MD5 c1b39b5a120b9bea2dc4144b30482916
BLAKE2b-256 9b6835af1a27d2251518ded6c4cac182ff3cd4028f52e233f0a554068b2bc2e6

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f078888a70ae946014b519ab1ee3790b4b69678db3054fb02b9ee9b7160ad645
MD5 dcc637e033579f39b4687a6984065d05
BLAKE2b-256 95d09cb956cce346ef1a8897d062d3248631a5a7c6de8258e49e2d80ed8b5ac6

See more details on using hashes here.

File details

Details for the file zignal_processing-0.9.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.9.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e65cb3aac565e85f69ddeaa7329412c97be52c7a8e9e16b49ff326f2d40258e6
MD5 f7a3464495884c79ffa52df286c50a7c
BLAKE2b-256 967f7fb262deca40752b4e42a8c6f248893c21590fb54d58066462c825634294

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page