saturnix-filter
High-performance camera film simulation filters in Rust, designed for the SATURNIX open-source camera (Raspberry Pi Zero 2W).
Developed to accelerate on-device photo processing, saturnix-filter delivers a ~47x to ~134x speedup over traditional pure-Python image processing on the target Raspberry Pi Zero 2 W hardware by leveraging zero-copy in-memory pixel manipulation, 10-bit fixed-point integer math, and multicore scaling via Rayon.
Features
- Zero-Copy Memory Model: Manipulates Pillow image bytes directly in memory space
- Parallel Execution: Distributes row-by-row pixel computations across all available CPU cores using
rayon. - 26 Complete Film Styles:
S-Gold(Kodak Gold warm vintage style)S-Vivid(Kodak Ektar ultra-saturated style)S-Natural(Fujifilm organic greens style)S-Saturnix(Signature cel-animation glow style)S-MonoX(Kodak Tri-X 400 panchromatic S-curve B&W style)S-Portra(Kodak Portra 400 soft, warm skin-tone style)S-Cinestill(Cinestill 800T cool tungsten / teal-shadow style)S-Cross(Cross-processed E-6-in-C-41 high-contrast style)S-Faded(Sun-faded vintage print with milky lifted blacks)S-Bleach(Bleach-bypass desaturated high-contrast silver style)S-Sepia(Warm brown-toned B&W)S-Cyano(Cool blue Cyanotype-toned B&W)S-Noir(High-contrast neutral B&W with heavy vignette)S-Teal(Cinematic teal-and-orange style)S-Lomo(Lomography toy-camera oversaturated style)S-Fuji(Fujifilm Velvia high-saturation landscape style)S-Selenium(Cool selenium-toned B&W)S-Platinum(Warm, soft platinum-print-toned B&W)S-Infrared(Aerochrome-style false-colour infrared)S-SplitTone(Cinematic warm-highlight / cool-shadow split-toning)S-Kodachrome(Rich, warm vintage-slide style)S-Polaroid(Instant-film look with milky blacks and cyan cast)S-Matrix(Digital-dystopia green cast)S-Cine(Filmic S-curve digital-cinema grade)S-Leak(Warm light-leak flare from the corner)S-Halation(Warm red-orange glow blooming from highlights)S-CA(Lo-fi lens look with red/blue chromatic-aberration fringing)VHS(Vintage VHS tape simulation)
Examples
Each column is one source photo; each row is the same image with a filter applied.
| Sample 01 | Sample 02 | Sample 03 | Sample 04 | |
|---|---|---|---|---|
| Original | ||||
| S-Gold | ||||
| S-Vivid | ||||
| S-Natural | ||||
| S-Saturnix | ||||
| S-MonoX | ||||
| S-Portra | ||||
| S-Cinestill | ||||
| S-Cross | ||||
| S-Faded | ||||
| S-Bleach | ||||
| S-Sepia | ||||
| S-Cyano | ||||
| S-Noir | ||||
| S-Teal | ||||
| S-Lomo | ||||
| S-Fuji | ||||
| S-Selenium | ||||
| S-Platinum | ||||
| S-Infrared | ||||
| S-SplitTone | ||||
| S-Kodachrome | ||||
| S-Polaroid | ||||
| S-Matrix | ||||
| S-Cine | ||||
| S-Leak | ||||
| S-Halation | ||||
| S-CA | ||||
| VHS |
Installation
Install the precompiled binary wheel directly from PyPI (no compiler required on the Raspberry Pi!):
pip install saturnix-filter
The core install has no Python dependencies — ideal for the production
runtime on the Raspberry Pi. To also get the saturnix-filter command-line
tool for experimenting on a PC (image file conversion, gallery rendering),
install the optional cli extra:
pip install "saturnix-filter[cli]"
Usage
from PIL import Image
import saturnix_filter
# 1. Load an image as RGB
img = Image.open("photo.jpg").convert("RGB")
width, height = img.size
# 2. Extract mutable bytearray (Zero-Copy pointer reference)
buf = bytearray(img.tobytes())
# 3. Apply the filter instantly inside RAM
# Supported options: "S-Gold", "S-Vivid", "S-Natural", "S-Saturnix", "S-MonoX",
# "S-Portra", "S-Cinestill", "S-Cross", "S-Faded", "S-Bleach",
# "S-Sepia", "S-Cyano", "S-Noir", "S-Teal", "S-Lomo", "S-Fuji",
# "S-Selenium", "S-Platinum", "S-Infrared", "S-SplitTone",
# "S-Kodachrome", "S-Polaroid", "S-Matrix", "S-Cine",
# "S-Leak", "S-Halation", "S-CA", "VHS"
saturnix_filter.apply_film_inplace(buf, width, height, "S-Saturnix")
# 4. Re-construct the Pillow image from the modified buffer
filtered_img = Image.frombytes("RGB", (width, height), bytes(buf))
filtered_img.save("photo_filtered.jpg", "JPEG", quality=92)
Command-line tool
With the cli extra installed, the saturnix-filter command converts image
files directly:
# Apply a filter (auto-names the output photo_s-gold.jpg next to the input)
saturnix-filter convert photo.jpg -f S-Gold
# Several filters and/or images at once, downscaled to 1200 px wide
saturnix-filter convert *.jpg -f S-Gold -f S-Halation --max-width 1200
# List every available filter with a description
saturnix-filter list
# Apply every filter to one image, rendering a gallery next to it
saturnix-filter gallery photo.jpg
Performance Comparison
All numbers are pure in-memory processing times at full 16 MP camera resolution (4656 x 3496 pixels), measured with a warm-up pass and excluding file I/O. saturnix-filter uses the optimized 10-bit fixed-point integer implementation.
Hardware: Raspberry Pi Zero 2 W (ARM Cortex-A53 quad-core @ 1.0 GHz)
All profiles share the same base point operations (tone curve, saturation, contrast, vignette, grain); the Pipeline column lists the extra stages that set a profile apart:
- mono – monochrome conversion: collapses the image to a tinted luminance channel for black-and-white looks.
- mix – 3×3 channel-mix matrix: blends the R/G/B channels into each other for cross-channel colour shifts.
- s-curve – filmic S-curve tone shaping for richer contrast in the mid-tones while protecting highlights and shadows.
- split-tone – tints highlights and shadows with separate colours (e.g. warm highlights, cool shadows).
- leak – light-leak: adds a coloured flare that falls off from one corner, applied in the main pixel pass.
- halation – bloom post-pass: bright highlights bleed a soft coloured glow into their surroundings (a second image pass, hence slower).
- CA – chromatic aberration post-pass: shifts the red and blue channels radially for lens-style colour fringing (a second image pass, hence slower).
| Filter | Original Python | saturnix-filter |
Speedup | Pipeline (extra stages) |
|---|---|---|---|---|
| S-Gold | 16.729 s | 0.241 s | ~69.4x | – |
| S-Vivid | 16.711 s | 0.354 s | ~47.2x | mix |
| S-Natural | 16.702 s | 0.240 s | ~69.6x | – |
| S-Saturnix | 32.083 s | 0.240 s | ~133.7x | – |
| S-MonoX | 31.841 s | 0.249 s | ~127.9x | mono |
| S-Portra | – | 0.240 s | – | – |
| S-Cross | – | 0.354 s | – | mix |
| S-Faded | – | 0.240 s | – | – |
| S-Bleach | – | 0.240 s | – | – |
| S-Sepia | – | 0.249 s | – | mono |
| S-Cyano | – | 0.249 s | – | mono |
| S-Noir | – | 0.249 s | – | mono |
| S-Teal | – | 0.240 s | – | – |
| S-Lomo | – | 0.240 s | – | – |
| S-Fuji | – | 0.354 s | – | mix |
| S-Selenium | – | 0.249 s | – | mono |
| S-Platinum | – | 0.249 s | – | mono |
| S-Infrared | – | 0.354 s | – | mix |
| S-SplitTone | – | 0.240 s | – | split-tone |
| S-Kodachrome | – | 0.355 s | – | mix, split-tone |
| S-Polaroid | – | 0.242 s | – | split-tone |
| S-Matrix | – | 0.354 s | – | mix, split-tone |
| S-Cine | – | 0.241 s | – | s-curve, split-tone |
| S-Leak | – | 0.320 s | – | leak |
| S-CA | – | 0.637 s | – | CA |
| S-Cinestill | – | 1.503 s | – | mix, halation |
| S-Halation | – | 1.388 s | – | halation |
| VHS | 18.452 s | 0.351 s | ~52.6x | dedicated VHS pipeline |
License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for saturnix-filter 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| saturnix_filter-0.3.1.tar.gz | 10.4 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| saturnix_filter-0.3.1-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| saturnix_filter-0.3.1-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| saturnix_filter-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 12.0 MB
Release files / saturnix_filter-0.3.1.tar.gz
| Download URL | saturnix_filter-0.3.1.tar.gz |
|---|---|
| Size | 10.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd9bf29538ed82e48f6def358435f993cc91beea6a435e96c4f09bc02e23fe8c
|
|
BLAKE2b-256 checksum How to use checksums |
ecb27f4f792ab565978e6198e84e20efeb4fbd74bdc48183cc3fb653379479a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / saturnix_filter-0.3.1-cp39-abi3-win_amd64.whl
| Download URL | saturnix_filter-0.3.1-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 235.7 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
091ac4eced600d377e8ff0ef0f73ce04189a0249989b0f19136f5be3bf30dcb1
|
|
BLAKE2b-256 checksum How to use checksums |
2f140c13476bca2efc61164c9fa9216be5db119b806278da336095a903510c4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 377.4 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2dc8a7b0e6d4dd394aa7368485794b6d8364ba56851f7ceed0145c42a8dbf1a1
|
|
BLAKE2b-256 checksum How to use checksums |
7bda6c0f076e10560cb53a5b29b5e31c4e3948a191b65ad55ce429e8de3f6c8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | saturnix_filter-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 370.9 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
bba5771851349ff40481952ed7ddb2f453535df9d86e5800e0c7c6647ffa135a
|
|
BLAKE2b-256 checksum How to use checksums |
2aa6e6492b9d0a0c79957be658e6cea1e68673c59f5528ab280a81597e4c7899
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / saturnix_filter-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | saturnix_filter-0.3.1-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 326.5 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
94a41f8d1eba2079389c00cf34e4ac4e3c6474d030457cc0d0b499d34adc49b8
|
|
BLAKE2b-256 checksum How to use checksums |
5caf1c004b98c98d18998ac358e102c93b1f2a4b216ef42bb71ba8c7290915fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency logRelease files / saturnix_filter-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | saturnix_filter-0.3.1-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 332.2 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
65778b5a4c543d5e7441f854a6d703737846d97b22a339ffbc3d28c645a4ff2c
|
|
BLAKE2b-256 checksum How to use checksums |
a237edd2c155f3db53cb77eea121ee2068dd8eebb545ffc72f4bcc73b605970d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.
Transparency log