Skip to main content

Zero-dependency image processing library

Project description

Zignal Python Bindings

Zero-dependency image processing library written in Zig with Python bindings.

Installation

pip install zignal-processing

Quick Start

import zignal

# Create RGB color
red = zignal.Rgb(255, 0, 0)
print(f"Red color: {red}")

# Convert to HSV
hsv = red.to_hsv()
print(f"HSV: {hsv}")

# Convert to other color spaces
lab = red.to_lab()
oklab = red.to_oklab()
xyz = red.to_xyz()

Features

  • 12 Color Spaces: RGB, RGBA, HSV, HSL, Lab, XYZ, Oklab, Oklch, LCH, LMS, XYB, YCbCr
  • Seamless Conversions: Convert between any supported color spaces
  • Type Safety: Strong typing with validation for color components
  • Zero Dependencies: No external dependencies, pure Zig implementation
  • High Performance: Native performance with minimal overhead
  • Cross Platform: Works on Linux, macOS, and Windows (x86_64 and ARM64)

Supported Color Spaces

  • RGB/RGBA: Standard RGB with optional alpha channel (0-255)
  • HSV: Hue, Saturation, Value (0-360°, 0-100%, 0-100%)
  • HSL: Hue, Saturation, Lightness (0-360°, 0-100%, 0-100%)
  • Lab: CIELAB perceptual color space
  • XYZ: CIE 1931 XYZ color space
  • Oklab: Perceptually uniform color space by Björn Ottosson
  • Oklch: Cylindrical representation of Oklab
  • LCH: Cylindrical representation of Lab
  • LMS: Long, Medium, Short cone response
  • XYB: Color space used in JPEG XL
  • YCbCr: Luma and chroma components

Examples

Color Space Conversions

# Create a color in any space
hsl = zignal.Hsl(180.0, 50.0, 50.0)  # Cyan-ish color

# Convert to any other space
rgb = hsl.to_rgb()
lab = hsl.to_lab()
oklab = hsl.to_oklab()

# Chain conversions
original = zignal.Rgb(128, 64, 192)
hsv = original.to_hsv()
back_to_rgb = hsv.to_rgb()

Working with Alpha Channel

# Create RGBA color
rgba = zignal.Rgba(255, 128, 0, 200)  # Orange with transparency

# Convert RGB to RGBA (default alpha=255)
rgb = zignal.Rgb(255, 128, 0)
rgba = rgb.to_rgba()

Modern Color Spaces

# Oklab - perceptually uniform color space
oklab = zignal.Oklab(0.5, 0.1, -0.05)
oklch = oklab.to_oklch()  # Convert to cylindrical form

# Work with perceptual properties
print(f"Lightness: {oklch.l}")
print(f"Chroma: {oklch.c}")
print(f"Hue: {oklch.h}")

Building from Source

Requires Zig compiler:

git clone https://github.com/bfactory-ai/zignal
cd zignal/bindings/python
pip install -e .

License

MIT License

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.1.0.tar.gz (10.4 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.1.0-cp313-cp313-win_amd64.whl (260.8 kB view details)

Uploaded CPython 3.13Windows x86-64

zignal_processing-0.1.0-cp313-cp313-manylinux1_x86_64.whl (734.2 kB view details)

Uploaded CPython 3.13

zignal_processing-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (189.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

zignal_processing-0.1.0-cp313-cp313-macosx_10_9_x86_64.whl (208.0 kB view details)

Uploaded CPython 3.13macOS 10.9+ x86-64

zignal_processing-0.1.0-cp312-cp312-win_amd64.whl (260.8 kB view details)

Uploaded CPython 3.12Windows x86-64

zignal_processing-0.1.0-cp312-cp312-manylinux1_x86_64.whl (734.2 kB view details)

Uploaded CPython 3.12

zignal_processing-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (189.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

zignal_processing-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl (208.0 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

zignal_processing-0.1.0-cp311-cp311-win_amd64.whl (260.6 kB view details)

Uploaded CPython 3.11Windows x86-64

zignal_processing-0.1.0-cp311-cp311-manylinux1_x86_64.whl (732.5 kB view details)

Uploaded CPython 3.11

zignal_processing-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (189.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

zignal_processing-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl (207.8 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

zignal_processing-0.1.0-cp310-cp310-win_amd64.whl (260.6 kB view details)

Uploaded CPython 3.10Windows x86-64

zignal_processing-0.1.0-cp310-cp310-manylinux1_x86_64.whl (734.0 kB view details)

Uploaded CPython 3.10

zignal_processing-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (189.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

zignal_processing-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl (207.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

zignal_processing-0.1.0-cp39-cp39-win_amd64.whl (260.6 kB view details)

Uploaded CPython 3.9Windows x86-64

zignal_processing-0.1.0-cp39-cp39-manylinux1_x86_64.whl (734.1 kB view details)

Uploaded CPython 3.9

zignal_processing-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (189.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

zignal_processing-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl (207.9 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for zignal_processing-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e104159d9fe7b546875085da47187590d236967762d14d7fbd2db48e359d6023
MD5 98670c1f489d4e6f3fa403b308acabff
BLAKE2b-256 5c998e9bbaa74685df70818e1cd7ff81cd2e41426ec5f50a87c07b2fb8a8dd8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0827692012ce7284fa3ef49c1bb1e10f93120b9fb5534bae9fbdf94cdb9ebfe9
MD5 e4dfa7fb40afd64c211cf0a6a03f273b
BLAKE2b-256 85c86fe50e30e8d00a2afea4bb30bbc8770cd150c0687897558dd6413a365446

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1d0eb1795ff3876d435c5d4ee4a9da2af9156447318b9e7e5032e5e2236f606c
MD5 f6e6d3c9c92832e8b96f16ba85f4b97f
BLAKE2b-256 1a45c9568fa941b1924494b2345856a376a90ceaf2fe74c5093077e1ea6b0ab0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31398fb243e1e8ab50c057fabb9a1740f8cb178d4fe9c8ffc00ec4f4eb41e2d2
MD5 c4911dabb590332307f1d7f0e827d3e8
BLAKE2b-256 bacc0e688f1fe9db33644c19c931f639c2823ee1583abc38de2291614a73d09e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp313-cp313-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 480b4d934182718f9f5926fb0c249f31d6c691dec037a481260fe74b7042eac6
MD5 9602d9cf01745b6af6015389f6242468
BLAKE2b-256 45898d09781cf1bf7d996662b7abb206b3049995bc30e269417c62e3717743aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9d8f12214951809ae8faaf52e96b2f7f47bbc66fbc729c3228278c7cd79dda0f
MD5 a65642950ddd23bb2b4a6dae884f9c90
BLAKE2b-256 3c563f819d6d3f9f3f568cac4035e3757708631bfdbb61364e4beb2a803e3b36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1badcc69ab235f029d616bb0fcf47c0c6a9306f8a40d9466c2de588505eb169a
MD5 a99fdd56ab8ce21057182113fcbc10d2
BLAKE2b-256 fc679914a42544862cdeeaaa5dd54b02bfc318291c7aca579b57d19be0d17bde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cec13fa57f6bda1c802f475c116214ed17df86e6527d82aa3192cc000a1231f
MD5 b65ca8779a3c76e59332fa75ada54a6c
BLAKE2b-256 55e3ddc52b345542e6a10d669f58d6d28f91428c4141ff198458feeb114dd6fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5eca8d30891522e2337f0e6dbaa66c51b52c778d1c4e417ad83faee8089fc6ae
MD5 a087a5cedf3e9bae56d7b561d79b8094
BLAKE2b-256 c9ed2dd298210db44b209fc01d35139d248255f43424ee232abe26dc2ee64f39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f32a4d92769eb12c16079f9c2d25dde76ca2fa07e95797caf3fe901abafd36c8
MD5 6b0cf8ef87c4fca7a2be702261732b65
BLAKE2b-256 ae64c7abd09a6525811deeb2bb2abec91123eb0fe290442ce07fd92f967e3150

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d06859ac380d09d4604aa5a890ba4649874d800e5356b4fc7a55bf56836958db
MD5 d4eee51d954f6213d001834cedc19339
BLAKE2b-256 62b51d0872a77127b7a95e3dbf253a60a4c11002149dd2c78979b9cb167b1d2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3cf797396f0ce57f786d21a45115dd3ffe7f2f8b0c290177a2ec226c171cb12
MD5 aba4ae0e857676844fef78ebb478e206
BLAKE2b-256 224e35dd0fb8b2bc62233de1251e5f1d831ec937f6ed0e4370e0a20713239a8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e56c3f60d51396f53fca849504172f7d6f8d55ac369c8bf427bd027414f37624
MD5 e5a2fa328ade649be3d6d4d39b7132f5
BLAKE2b-256 2e55c370a9ad55674ce99f2577ee76b7e3cbeefb9783138d93247bdfb07d75ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b8824777c4ba9c7e79d77d8dd3ea28bc31dc9473363d664a7f1dde435dca3314
MD5 9d1d4e77cebab4b3dd112893d6aed216
BLAKE2b-256 42f5dcd01b3b5bc1965844da0fe914a5afbe4a2f0a6b7dd09bda82deed74959b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6a87f5445f592e974f856c155e055273b2c88c6213184852276649d3991dcec1
MD5 ceb093f45ea101ebd2e44104163efcff
BLAKE2b-256 7b237a0822a45b4e96b0c0de23ef6e05d620e3fab6476d481671c806b28a955a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18c21d1ed49e4fdcc695d05ec9cfe47b093059ab50d4b57214f3008a7d301d91
MD5 be5e7f411ae3a66d4bdfb3a5eca69dc5
BLAKE2b-256 554593481f412e67f308f7fc0d80724df1a2d9d65c8db4e2022febdc1356f0f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cd8782ca93df1554a1ff1f2a843af03df60eeab3bc566fda3710c961f9d067e2
MD5 4574ccd13e3d831e111fd67952fb818f
BLAKE2b-256 f69d1191df9352b95a163771ef24dc171225c67a62913df4ec07fe4aeda32610

See more details on using hashes here.

File details

Details for the file zignal_processing-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1224dc9168cb15d59f2f499499c4ef2d21f5f5e030af111b1fd74bd47549b427
MD5 d129175588b6de1bfc5ea6978dfdff10
BLAKE2b-256 e7c3a2d8c48c4d35cd7f69b2911c4a99bac84ef994e90c2d6b76f7267f5470c9

See more details on using hashes here.

File details

Details for the file zignal_processing-0.1.0-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5330b00d78200444c7615e206f81d3bb274740ed46c8428e2a24a06bb4c5f8d3
MD5 e33d8d023d98892a7244230e5e7906ce
BLAKE2b-256 a4afacbc83b83bb2096329ee334661c5dca95e50d882760bc4a7f5cc273817d3

See more details on using hashes here.

File details

Details for the file zignal_processing-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e18b3e984a457683dcb1e919bb7697c0d7fc891ab4fca0e780c1b47eabbe5b74
MD5 7b22164b274e0ad8293569ba95b06b38
BLAKE2b-256 3caee1f9a66151e2e9f2ab79f1f6661c7a09de3026fbf73ea1e002bacf836828

See more details on using hashes here.

File details

Details for the file zignal_processing-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for zignal_processing-0.1.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 175b1421a2c4b066af2b4ad287b89f5ff91b73e8dc7cedfed9baf152b03e66ae
MD5 2a8312cdf8808aabf72adc0f41ee0993
BLAKE2b-256 d883951fd74f85dcdd1efbabcd5f4df9c8775aac2323ac18a0c1303468c5030e

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