Skip to content

arrufat/zignal

Repository files navigation

Zignal

tests docs PyPI version

Zignal is a zero-dependency image processing library inspired by dlib.

Features

  • Core Math: Matrices (SMatrix, Matrix, SVD), PCA, ND Geometry (SIMD Points, affine/projective transforms, convex hull), Statistics, Optimization.
  • Computer Vision: Feature detection and matching (FAST, ORB), Edge detection (Shen-Castan), Hough Transform, Feature Distribution Matching (style transfer).
  • Image Processing: Spatial transforms (resize, crop, rotate), morphology, convolution filters (blur, sharpen), thresholding, advanced Color Spaces (Lab, Oklab, Oklch, Xyb, Lms, etc.), Perlin noise generation.
  • I/O & Graphics: Pure-Zig PNG/JPEG codecs, Canvas API (antialiasing, Bézier curves), Bitmap/PCF Fonts, Colormaps, Terminal graphics (Kitty/Sixel).
  • Platform Support: Native Zig, first-class Python bindings, and WASM compilation for the web.

Status

Zignal is under active development and the API continues to evolve. Expect occasional breaking changes between minor releases.

Installation

Zig

zig fetch --save git+https://github.com/arrufat/zignal

Then, in your build.zig

const zignal = b.dependency("zignal", .{ .target = target, .optimize = optimize });
// And assuming that your b.addExecutable `exe`:
exe.root_module.addImport("zignal", zignal.module("zignal"));
// If you're creating a `module` using b.createModule, then:
module.addImport("zignal", zignal.module("zignal"));

Examples | Documentation

Python

pip install zignal-processing

Requires Python 3.10+, no external dependencies

Bindings | PyPI Package | Documentation

CLI

Zignal includes a command-line interface for common operations.

# Build the CLI
zig build

# Run commands
zig-out/bin/zignal <command> [options]

Available commands:

  • display - View images in the terminal (supports Kitty, Sixel, etc.)
  • resize - Resize images with various filters
  • tile - Combine multiple images into a grid
  • fdm - Apply style transfer (Feature Distribution Matching)
  • info - Show image metadata

Examples

Interactive demos showcasing Zignal's capabilities:

Sponsors

Special thanks to B Factory, Inc, the Founding Sponsor of Zignal. I originally developed this library internally for Ameli's virtual makeup try-on system, and B Factory graciously transferred ownership to the community to ensure its long-term maintenance and growth.



Star History Chart