Skip to main content

High-performance camera film simulation filters

Project description

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 ~41x to ~91x 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.
  • 6 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)
    • VHS (Vintage VHS tape simulation)

Installation

Install the precompiled binary wheel directly from PyPI (no compiler required on the Raspberry Pi!):

pip install saturnix-filter

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", "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)

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)

Filter Original Python saturnix-filter Speedup
S-Gold 16.729 s 0.375 s ~44.6x
S-Vivid 16.711 s 0.405 s ~41.3x
S-Natural 16.702 s 0.374 s ~44.7x
S-Saturnix 32.083 s 0.392 s ~81.9x
S-MonoX 31.841 s 0.350 s ~91.0x
VHS 18.452 s 0.351 s ~52.5x

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

saturnix_filter-0.1.0.tar.gz (60.2 kB view details)

Uploaded Source

Built Distributions

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

saturnix_filter-0.1.0-cp39-abi3-win_amd64.whl (186.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (317.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

saturnix_filter-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (275.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

saturnix_filter-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (280.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: saturnix_filter-0.1.0.tar.gz
  • Upload date:
  • Size: 60.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for saturnix_filter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d2d4a19a0034287e9c886f23b0343859066dfc6080e18ea5df16666d259b0bf
MD5 d40f3961460a66032583fd9028f00c3a
BLAKE2b-256 e2a24a369f45f8a0cb22dbbc934af0d4b2eb33268d2811e13aff93a6be50bc81

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0.tar.gz:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saturnix_filter-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for saturnix_filter-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8d0987446a2dfb7803f24ec99c6b0fd7582496e87614a2dff20455b229d34a90
MD5 9a1213848b1c7e357d09b1590f407cc0
BLAKE2b-256 3fb89ae28f2e25bf8c2fc27b8ba99555211fc514e4c5c12f2c25d516c678b6dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e4f20cac8af8a23dac3153b85e8d93a51fd6c7993bcc9c87ea9699dbb5213cd
MD5 46829358704d131b5a2544cb345111a7
BLAKE2b-256 f871e3844cd708a4d273de87b6e168c96fa8bb16b04eaf2438a825bbc8fe1250

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 032d2b0e86f84b7f1f5508d67ba641aa4c2384e791f08288c988d145a1789258
MD5 c10858f39ee61add727548696357f484
BLAKE2b-256 8d7ad5ae89c767b2150d1998586c11fe696d94b0c003290ac4f28e23f8074cd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saturnix_filter-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for saturnix_filter-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ab5760b580fe24ea16dced878aca3bafb543d5bbf9c2289f4e15779f18cfc0f
MD5 4f840c4d4735bd9ee8147cb225dad145
BLAKE2b-256 cca6bbb44bbf05203d069a3e037706d930588e4ae427b52946c3abdf30ba7dd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saturnix_filter-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for saturnix_filter-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 245c722a98092128190f368123d76ee41903be88ea0839a764f079ec3781f621
MD5 bf382916c90fa815add9b39ae9355ef4
BLAKE2b-256 93690b62ec87f3fd27468d3bdcbd63d9adb05757ce262b6160fc019d0b127c28

See more details on using hashes here.

Provenance

The following attestation bundles were made for saturnix_filter-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on oberbichler/saturnix-filter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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