Python ctypes bindings for the RedNoise CPU software renderer, with the native library bundled.
Project description
RedNoise Python bindings
Python ctypes bindings for the RedNoise CPU software renderer. They call the
stable C ABI declared in include/rednoise/rednoise.h. There is no compiled
extension module: the bindings load the RedNoise shared library at runtime. The
native library is built and bundled into the package, so a normal install is
self-contained.
Install
pip install rednoise
Prebuilt wheels ship the native library, so on a supported platform this is all
you need. Installing from an sdist compiles the native library on your machine
via CMake, so you need a C++23-capable compiler (GCC 12+, Clang 15+, or MSVC
2022+) and CMake 3.24 or newer. The build uses the vendored glm in
third_party/ and runs fully offline; it does not fetch SDL3 or any other
optional dependency.
Under the hood, pip install drives scikit-build-core and CMake to build only
the installable rednoise library (-DBUILD_LIB=ON, everything else off) and
installs the resulting shared library into the importable rednoise/ package:
- Linux:
librednoise.so - macOS:
librednoise.dylib - Windows:
rednoise.dll
Pillow is optional and only needed for Image.to_pillow() or saving non-PNG
formats:
pip install "rednoise[pillow]"
Library discovery
The bundled library is found automatically. For development against a separately built library, the bindings locate it in this order:
- The library bundled next to the package (what a wheel installs).
- The
REDNOISE_LIBRARYenvironment variable (an explicit path to the file). - The system search path (
ctypes.util.find_library("rednoise")). - Common local build paths (
build/, next to the package, and similar).
To override with a locally built library, set REDNOISE_LIBRARY:
# Linux
export REDNOISE_LIBRARY="$PWD/build/librednoise.so"
# macOS
export REDNOISE_LIBRARY="$PWD/build/librednoise.dylib"
# Windows (cmd)
set REDNOISE_LIBRARY=%CD%\build\rednoise.dll
Develop from a local checkout
Install the bindings straight from this directory:
pip install ./bindings/python
Add the Pillow extra with:
pip install "./bindings/python[pillow]"
You can still build the shared library by hand from the repository root and
point REDNOISE_LIBRARY at it:
cmake -B build -S . -DBUILD_LIB=ON -DBUILD_APP=OFF
cmake --build build
Usage
import rednoise
print(rednoise.version())
with rednoise.Scene.load_obj("assets/cornell-box.obj") as scene:
print("triangles:", scene.triangle_count)
image = scene.render(mode="pathtraced", width=400, height=300, samples=64)
image.save("cornell.png")
Scene.render accepts a render mode as a RenderMode enum, an integer, or a
name string: "wireframe", "rasterised", "raytraced", or "pathtraced".
The returned Image exposes .rgba (raw RGBA8 bytes), .size, .save(path),
and .to_pillow() when Pillow is installed.
A complete runnable example lives in example.py. Run it from the repository
root (after building the library and setting REDNOISE_LIBRARY):
python bindings/python/example.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rednoise-0.2.0.tar.gz.
File metadata
- Download URL: rednoise-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6436f88c501899d05d4774965ada30387b394dc0b57553621115d305c0ae872e
|
|
| MD5 |
1d4a6c2c7c591b20ac3800791262cf40
|
|
| BLAKE2b-256 |
ec7dface095dc4b99eb8c8e88e2020a47e83b17deb4ce772cefe091a4c122f00
|
Provenance
The following attestation bundles were made for rednoise-0.2.0.tar.gz:
Publisher:
release.yml on ReverseZoom2151/rednoise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednoise-0.2.0.tar.gz -
Subject digest:
6436f88c501899d05d4774965ada30387b394dc0b57553621115d305c0ae872e - Sigstore transparency entry: 2073827937
- Sigstore integration time:
-
Permalink:
ReverseZoom2151/rednoise@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ReverseZoom2151
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file rednoise-0.2.0-py3-none-win_amd64.whl.
File metadata
- Download URL: rednoise-0.2.0-py3-none-win_amd64.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5001aca3d72d52abc4eb78b399d950ef970e3b0ada3702eb956aa0051012d9a3
|
|
| MD5 |
73d48fc1554b76621e4a66d54333eed6
|
|
| BLAKE2b-256 |
cea279171d9d5100430b4d1120884097b7bafee168c87ad32f752e1a43c932dc
|
Provenance
The following attestation bundles were made for rednoise-0.2.0-py3-none-win_amd64.whl:
Publisher:
release.yml on ReverseZoom2151/rednoise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednoise-0.2.0-py3-none-win_amd64.whl -
Subject digest:
5001aca3d72d52abc4eb78b399d950ef970e3b0ada3702eb956aa0051012d9a3 - Sigstore transparency entry: 2073828070
- Sigstore integration time:
-
Permalink:
ReverseZoom2151/rednoise@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ReverseZoom2151
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file rednoise-0.2.0-py3-none-win32.whl.
File metadata
- Download URL: rednoise-0.2.0-py3-none-win32.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6aacb46995ed114417bd51c603b895e9b1072260a462a08271c1f3db5619e33
|
|
| MD5 |
706c1a1c6955934db97c399aa89ccc09
|
|
| BLAKE2b-256 |
e74c1f92a087e1d8c0b599f9632117f9efa6958acff5383de3f14201bbe4e93a
|
Provenance
The following attestation bundles were made for rednoise-0.2.0-py3-none-win32.whl:
Publisher:
release.yml on ReverseZoom2151/rednoise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednoise-0.2.0-py3-none-win32.whl -
Subject digest:
c6aacb46995ed114417bd51c603b895e9b1072260a462a08271c1f3db5619e33 - Sigstore transparency entry: 2073828024
- Sigstore integration time:
-
Permalink:
ReverseZoom2151/rednoise@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ReverseZoom2151
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file rednoise-0.2.0-py3-none-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: rednoise-0.2.0-py3-none-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ac96343853a72800937ba9d434db076ddb3e277a1b228642cadd5d05fa8b5c
|
|
| MD5 |
853fbf9dff2dc33bda767feb7a9128c7
|
|
| BLAKE2b-256 |
a9fdaa6230b22b2c25fb99c4daeb8785a72bb93bfbc0393a9b97d3f26d60d2f4
|
Provenance
The following attestation bundles were made for rednoise-0.2.0-py3-none-manylinux_2_34_x86_64.whl:
Publisher:
release.yml on ReverseZoom2151/rednoise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednoise-0.2.0-py3-none-manylinux_2_34_x86_64.whl -
Subject digest:
15ac96343853a72800937ba9d434db076ddb3e277a1b228642cadd5d05fa8b5c - Sigstore transparency entry: 2073827980
- Sigstore integration time:
-
Permalink:
ReverseZoom2151/rednoise@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ReverseZoom2151
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file rednoise-0.2.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: rednoise-0.2.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e62fcd5819e0537cda61d317e339718adf15211b8e96a44148af84136a30b9a7
|
|
| MD5 |
bd7b65eba3195307af322a79e0ae4457
|
|
| BLAKE2b-256 |
c34846c018e87b0f626a54b0924cefaefcb3c21e13803234362e07fad59eab3c
|
Provenance
The following attestation bundles were made for rednoise-0.2.0-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on ReverseZoom2151/rednoise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rednoise-0.2.0-py3-none-macosx_11_0_arm64.whl -
Subject digest:
e62fcd5819e0537cda61d317e339718adf15211b8e96a44148af84136a30b9a7 - Sigstore transparency entry: 2073828127
- Sigstore integration time:
-
Permalink:
ReverseZoom2151/rednoise@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ReverseZoom2151
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@20ad6d05337c7febca6d4b6c6583fc6a92ae35cc -
Trigger Event:
push
-
Statement type: