Read and write OpenEXR files in Python with no system dependencies.
Project description
exrio
Fast and dependency-free python library for reading and writing OpenEXR files.
Installation
pip install exrio
Usage
Read an EXR file from disk (sRGB)
from exrio import load
image = load("path/to/image.exr")
pixels = image.to_pixels()
Read an EXR file from memory (ACES 2065-1)
import boto3
from exrio import ExrImage
s3 = boto3.client("s3")
buffer = s3.get_object(Bucket="bucket-name", Key="path/to/image.exr")["Body"].read()
image = ExrImage.from_buffer(buffer)
pixels = image.to_pixels()
print(f"Red Chromaticity: {image.chromaticities.red}")
print(f"Green Chromaticity: {image.chromaticities.green}")
print(f"Blue Chromaticity: {image.chromaticities.blue}")
Write an EXR file (sRGB)
image = ExrImage.from_pixels(pixels)
image.to_path("path/to/output.exr")
Write an EXR to S3 (ACEScg)
image = ExrImage.from_pixels_ACEScg(pixels)
s3 = boto3.client("s3")
s3.put_object(Bucket="bucket-name", Key="path/to/output.exr", Body=image.to_buffer())
Read a Custom Multi-Layer EXR
from exrio import load
image = load("path/to/image.exr")
print(f"Attributes: {image.attributes}")
print(f"Chromaticities: {image.chromaticities}")
for layer in image.layers:
print(f"Layer: {layer.name}")
print(f" Width: {layer.width}")
print(f" Height: {layer.height}")
print(f" Attributes: {layer.attributes}")
for channel in layer.channels:
print(f" Channel: {channel.name}")
print(f" Pixels: {channel.pixels.shape}, dtype: {channel.pixels.dtype}")
Write a Custom Multi-Layer EXR
from exrio import ExrImage, ExrLayer, ExrChannel
pixels = np.random.rand(1920 * 1080).astype(np.float32)
channels = [
ExrChannel(name="R", width=1920, height=1080, pixels=pixels),
ExrChannel(name="G", width=1920, height=1080, pixels=pixels),
ExrChannel(name="B", width=1920, height=1080, pixels=pixels),
]
mask = ExrChannel(name="A", width=1920, height=1080, pixels=pixels)
layer = ExrLayer(name="color", width=1920, height=1080, channels=channels)
mask_layer = ExrLayer(name="mask", width=1920, height=1080, channels=[mask])
chromaticities = Chromaticities(red=(0.68, 0.32), green=(0.265, 0.70), blue=(0.15, 0.06))
image = ExrImage(layers=[layer, mask_layer], chromaticities=chromaticities)
image.to_path("path/to/output.exr")
Development
Install Tools
Run Tests
uv sync
uv run pytest
Run Examples
uv sync
uv run examples/test.py
Publish
Create an account on test.pypi.org and register your GitHub OIDC provider on Publishing.
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
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 exrio-0.2.0.tar.gz.
File metadata
- Download URL: exrio-0.2.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c3bde59bc2eeb5246088855f63fb83c486e5113267f6f0135d8278c7abce090
|
|
| MD5 |
630e88e44d419e5d66b55c933f8738f6
|
|
| BLAKE2b-256 |
827e38f7c18e4ff5d02226020aa5b9c9836c68a68783dbc2289a8e73dc7564a6
|
Provenance
The following attestation bundles were made for exrio-0.2.0.tar.gz:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0.tar.gz -
Subject digest:
4c3bde59bc2eeb5246088855f63fb83c486e5113267f6f0135d8278c7abce090 - Sigstore transparency entry: 159178009
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file exrio-0.2.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: exrio-0.2.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 552.2 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ccab6798d71829e8a1ce677a141190beed8a0ec92d3b67bede6629bee2d58c3
|
|
| MD5 |
16c8f942dff501ea8ab1a39a32f2365d
|
|
| BLAKE2b-256 |
df28d75aaed96903e4c3762fdadbcb6503a3ef3151ae56ff6e899bb1cee90a17
|
Provenance
The following attestation bundles were made for exrio-0.2.0-cp39-abi3-win_amd64.whl:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0-cp39-abi3-win_amd64.whl -
Subject digest:
0ccab6798d71829e8a1ce677a141190beed8a0ec92d3b67bede6629bee2d58c3 - Sigstore transparency entry: 159178011
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file exrio-0.2.0-cp39-abi3-win32.whl.
File metadata
- Download URL: exrio-0.2.0-cp39-abi3-win32.whl
- Upload date:
- Size: 538.5 kB
- Tags: CPython 3.9+, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d03d4bf0b61c91c2de34266a8fa7d13e9551a9218c62b4765b8decbd9ee16fce
|
|
| MD5 |
bd5f13f17ead24beb28f10bdc107036b
|
|
| BLAKE2b-256 |
962e089826343e68c2b3c7d9ec1da8df901df358bee309dd6fec26f705ce248a
|
Provenance
The following attestation bundles were made for exrio-0.2.0-cp39-abi3-win32.whl:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0-cp39-abi3-win32.whl -
Subject digest:
d03d4bf0b61c91c2de34266a8fa7d13e9551a9218c62b4765b8decbd9ee16fce - Sigstore transparency entry: 159178021
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file exrio-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: exrio-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 754.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9f5ab3d3d87a5f32516c9ff4c9e157231887c301598a916958830281862d694
|
|
| MD5 |
fb14c92bf13fd654b568fe5b0664aeb0
|
|
| BLAKE2b-256 |
9a489ff52ca565832dcfe993476bed5a55d3ea95ff20529cbe8b88b1592b4383
|
Provenance
The following attestation bundles were made for exrio-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
b9f5ab3d3d87a5f32516c9ff4c9e157231887c301598a916958830281862d694 - Sigstore transparency entry: 159178018
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file exrio-0.2.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: exrio-0.2.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 809.7 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9afda311d761749abac13f3d705a13c153bfe056764321ca240abd0772a9474
|
|
| MD5 |
8f699083f6bfb5fef7f2c31a0008ceff
|
|
| BLAKE2b-256 |
85a51c496b9a6aeb17eb7ed33c7b76b1e715413b0fd593dcaf6bc5dfe828e470
|
Provenance
The following attestation bundles were made for exrio-0.2.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0-cp39-abi3-manylinux2014_i686.manylinux_2_17_i686.whl -
Subject digest:
b9afda311d761749abac13f3d705a13c153bfe056764321ca240abd0772a9474 - Sigstore transparency entry: 159178014
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file exrio-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: exrio-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 673.1 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cfa7ccc5f1f820fb6bfbec42ee117baad9f00cb1335433d3cf2efffc569462f
|
|
| MD5 |
2504def1592fbf4bcbf528868add3be4
|
|
| BLAKE2b-256 |
1120d38e462d44f987a2d770a2d823b9ac610b4022f8cebcb7ca8cb6f52cd88e
|
Provenance
The following attestation bundles were made for exrio-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on patrickhulce/exrio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
exrio-0.2.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
1cfa7ccc5f1f820fb6bfbec42ee117baad9f00cb1335433d3cf2efffc569462f - Sigstore transparency entry: 159178015
- Sigstore integration time:
-
Permalink:
patrickhulce/exrio@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/patrickhulce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3acc2331f6a43f93183052984fdc2cb7177c02cf -
Trigger Event:
push
-
Statement type: