https://github.com/arrufat/zignal
zero-dependency image processing library
https://github.com/arrufat/zignal
drawing geometry image-processing python svd-matrix-factorisation wasm webassembly zero-dependency zig zig-package
Last synced: 6 days ago
JSON representation
zero-dependency image processing library
- Host: GitHub
- URL: https://github.com/arrufat/zignal
- Owner: arrufat
- License: mit
- Created: 2024-04-13T06:47:14.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2026-03-21T15:50:28.000Z (16 days ago)
- Last Synced: 2026-03-22T06:02:27.700Z (15 days ago)
- Topics: drawing, geometry, image-processing, python, svd-matrix-factorisation, wasm, webassembly, zero-dependency, zig, zig-package
- Language: Zig
- Homepage: https://arrufat.github.io/zignal/
- Size: 4.14 MB
- Stars: 356
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Zignal
[](https://github.com/arrufat/zignal/actions/workflows/test.yml)
[](https://github.com/arrufat/zignal/actions/workflows/documentation.yml)
[](https://badge.fury.io/py/zignal-processing)
Zignal is a zero-dependency image processing library inspired by [dlib](https://dlib.net).
## 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 powers production workloads at [Ameli](https://ameli.co.kr/) for their makeup virtual try-on.
The API continues to evolve, so expect occasional breaking changes between minor releases.

## Installation
### Zig
```console
zig fetch --save git+https://github.com/arrufat/zignal
```
Then, in your `build.zig`
```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](examples) | [Documentation](https://arrufat.github.io/zignal/)
### Python
```console
pip install zignal-processing
```
Requires Python 3.10+, no external dependencies

[Bindings](bindings/python) | [PyPI Package](https://pypi.org/project/zignal-processing/) | [Documentation](https://arrufat.github.io/zignal/python/zignal.html)
### CLI
Zignal includes a command-line interface for common operations.
```bash
# Build the CLI
zig build
# Run commands
zig-out/bin/zignal [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](https://arrufat.github.io/zignal/examples) showcasing Zignal's capabilities:
- [Color space conversions](https://arrufat.github.io/zignal/examples/colorspaces.html) - Convert between RGB, HSL, Lab, Oklab, and more
- [Face alignment](https://arrufat.github.io/zignal/examples/face-alignment.html) - Facial landmark detection and alignment
- [Perlin noise generation](https://arrufat.github.io/zignal/examples/perlin-noise.html) - Procedural texture generation
- [Seam carving](https://arrufat.github.io/zignal/examples/seam-carving.html) - Content-aware image resizing
- [Feature distribution matching](https://arrufat.github.io/zignal/examples/fdm.html) - Statistical color transfer
- [Contrast enhancement](https://arrufat.github.io/zignal/examples/contrast-enhancement.html) - Autocontrast and histogram equalization side-by-side
- [White balance](https://arrufat.github.io/zignal/examples/white-balance.html) - Automatic color correction
- [Feature matching](https://arrufat.github.io/zignal/examples/feature_matching.html) - ORB feature detection and matching between images
- [Hough transform animation](https://arrufat.github.io/zignal/examples/hough-animation.html) - Real-time visualization of line detection
- [Metrics analyzer](https://arrufat.github.io/zignal/examples/metrics.html) - PSNR and SSIM comparison for reference vs. distorted images
## Sponsors
Special thanks to **[B Factory, Inc](https://www.bfactory.ai/)**, the **Founding Sponsor** of Zignal.
I originally developed this library internally for our virtual makeup try-on system, and B Factory
graciously transferred ownership to the community to ensure its long-term maintenance and growth.
[](https://www.star-history.com/#arrufat/zignal&Date)