{"id":25043846,"url":"https://github.com/patrickhulce/exrio","last_synced_at":"2025-03-30T23:26:04.491Z","repository":{"id":270141874,"uuid":"908750505","full_name":"patrickhulce/exrio","owner":"patrickhulce","description":"Fast and dependency-free python library for reading and writing OpenEXR files.","archived":false,"fork":false,"pushed_at":"2025-01-03T02:56:57.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T04:59:17.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickhulce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-26T21:45:33.000Z","updated_at":"2025-01-03T02:56:32.000Z","dependencies_parsed_at":"2024-12-28T19:27:04.064Z","dependency_job_id":"8e51e8bf-34a4-439e-ab0b-fda2f63b3d4b","html_url":"https://github.com/patrickhulce/exrio","commit_stats":null,"previous_names":["patrickhulce/exrio"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fexrio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fexrio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fexrio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhulce%2Fexrio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickhulce","download_url":"https://codeload.github.com/patrickhulce/exrio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246394138,"owners_count":20770080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-06T04:59:23.352Z","updated_at":"2025-03-30T23:26:04.472Z","avatar_url":"https://github.com/patrickhulce.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exrio\n\nFast and dependency-free python library for reading and writing OpenEXR files.\n\n## Installation\n\n```bash\npip install exrio\n```\n\n## Usage\n\n### Read an EXR file from disk (sRGB)\n\n```python\nfrom exrio import load\n\nimage = load(\"path/to/image.exr\")\npixels = image.to_pixels()\n```\n\n### Read an EXR file from memory (ACES 2065-1)\n\n```python\nimport boto3\nfrom exrio import ExrImage\n\ns3 = boto3.client(\"s3\")\nbuffer = s3.get_object(Bucket=\"bucket-name\", Key=\"path/to/image.exr\")[\"Body\"].read()\nimage = ExrImage.from_buffer(buffer)\npixels = image.to_pixels()\n\nprint(f\"Red Chromaticity: {image.chromaticities.red}\")\nprint(f\"Green Chromaticity: {image.chromaticities.green}\")\nprint(f\"Blue Chromaticity: {image.chromaticities.blue}\")\n```\n\n### Write an EXR file (sRGB)\n\n```python\nimage = ExrImage.from_pixels(pixels)\nimage.to_path(\"path/to/output.exr\")\n```\n\n### Write an EXR to S3 (ACEScg)\n\n```python\nimage = ExrImage.from_pixels_ACEScg(pixels)\ns3 = boto3.client(\"s3\")\ns3.put_object(Bucket=\"bucket-name\", Key=\"path/to/output.exr\", Body=image.to_buffer())\n```\n\n### Read a Custom Multi-Layer EXR\n\n```python\nfrom exrio import load\n\nimage = load(\"path/to/image.exr\")\nprint(f\"Attributes: {image.attributes}\")\nprint(f\"Chromaticities: {image.chromaticities}\")\n\nfor layer in image.layers:\n    print(f\"Layer: {layer.name}\")\n    print(f\"  Width: {layer.width}\")\n    print(f\"  Height: {layer.height}\")\n    print(f\"  Attributes: {layer.attributes}\")\n\n    for channel in layer.channels:\n        print(f\"    Channel: {channel.name}\")\n        print(f\"      Pixels: {channel.pixels.shape}, dtype: {channel.pixels.dtype}\")\n```\n\n### Write a Custom Multi-Layer EXR\n\n```python\nfrom exrio import ExrImage, ExrLayer, ExrChannel\n\npixels = np.random.rand(1920 * 1080).astype(np.float32)\n\nchannels = [\n    ExrChannel(name=\"R\", width=1920, height=1080, pixels=pixels),\n    ExrChannel(name=\"G\", width=1920, height=1080, pixels=pixels),\n    ExrChannel(name=\"B\", width=1920, height=1080, pixels=pixels),\n]\nmask = ExrChannel(name=\"A\", width=1920, height=1080, pixels=pixels)\nlayer = ExrLayer(name=\"color\", width=1920, height=1080, channels=channels)\nmask_layer = ExrLayer(name=\"mask\", width=1920, height=1080, channels=[mask])\nchromaticities = Chromaticities(red=(0.68, 0.32), green=(0.265, 0.70), blue=(0.15, 0.06))\nimage = ExrImage(layers=[layer, mask_layer], chromaticities=chromaticities)\nimage.to_path(\"path/to/output.exr\")\n```\n\n## Development\n\n### Install Tools\n\n- [Rust](https://www.rust-lang.org/tools/install)\n- [Python](https://www.python.org/downloads/)\n- [maturin](https://maturin.rs)\n\n### Run Tests\n\n```bash\nuv sync\nuv run pytest\n```\n\n### Run Examples\n\n```bash\nuv sync\nuv run examples/test.py\n```\n\n### Publish\n\nCreate an account on [test.pypi.org](https://test.pypi.org) and register your GitHub OIDC provider on [Publishing](https://test.pypi.org/manage/account/publishing/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fexrio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickhulce%2Fexrio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhulce%2Fexrio/lists"}