{"id":17222771,"url":"https://github.com/cheind/py-minexr","last_synced_at":"2025-07-12T03:35:41.640Z","repository":{"id":52847088,"uuid":"298481602","full_name":"cheind/py-minexr","owner":"cheind","description":"Minimal, standalone, fast Python OpenEXR reader for single-part, uncompressed scan-line files as produced by Blender.","archived":false,"fork":false,"pushed_at":"2022-06-14T12:04:54.000Z","size":652,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-14T00:17:08.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-25T05:59:59.000Z","updated_at":"2025-04-03T14:49:16.000Z","dependencies_parsed_at":"2022-08-23T08:02:07.081Z","dependency_job_id":null,"html_url":"https://github.com/cheind/py-minexr","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cheind/py-minexr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fpy-minexr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fpy-minexr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fpy-minexr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fpy-minexr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheind","download_url":"https://codeload.github.com/cheind/py-minexr/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fpy-minexr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264931562,"owners_count":23685048,"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":"2024-10-15T04:06:19.529Z","updated_at":"2025-07-12T03:35:41.171Z","avatar_url":"https://github.com/cheind.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![example workflow](https://github.com/cheind/py-minexr/actions/workflows/python-package.yml/badge.svg)\n\n# minexr\n\n**minexr** is a standalone, fast Python [OpenEXR](https://www.openexr.com/) reader for single-part, uncompressed scan-line files. It is compatible with `.exr` files produced by [Blender](http://blender.org).\n\n## Assumptions\n\n**minexr** makes a couple of assumptions about the `.exr` file to be read:\n\n1.  single-part files with arbitrary number of channels,\n1.  no pixel data compression, and\n1.  equal channel types (HALF, FLOAT, UINT).\n\nThese assumptions allow us to efficiently parse and read the `.exr` file. In particular we gain constant offsets between scan lines which allows us to read the entire image in (H,C,W) format without copying.\n\n## Usage\n\nThe following is taken from [example.py](./example.py)\n\n```python\nimport minexr\n\nwith open('file.exr', 'rb') as fp:\n        reader = minexr.load(fp)\n        rgba = reader.select(['Color.R','Color.G','Color.B','Color.A'])\n        # a HxWx4 np.array with dtype based on exr type.\n        ...\n```\n\nFull [example.py](./example.py) loads the following images\n\n\u003cp align=\"center\"\u003e\n  \u003cimg  src=\"etc/result.png\"\u003e\n\u003c/p\u003e\n\nwhich were previously rendered using Blender/EEVEE [cube.blend](./etc/cube.blend).\n\n## Runtime\n\nThe following timings are produced by [bench.py](./bench.py) by repeatable reading an RGBA image from an `.exr` file. Timings include file and numpy operations.\n\n|    Module     | [sec/image] | Note                        |\n| :-----------: | :---------: | --------------------------- |\n| OpenEXR 1.3.2 |    0.020    | with channel concatenate    |\n| OpenEXR 1.3.2 |    0.015    | without channel concatenate |\n|  **minexr**   |  **0.004**  | with channel concatenate    |\n\n## Install\n\nEither via pip\n\n```\npip install minexr\n```\n\nOr clone this repository and invoke\n\n```\npip install -e .\n```\n\n## Tests\n\nTo run the tests\n\n```\npytest\n```\n\n## Blender support\n\nUse a `FileOutput` node in Blender's compositor to export `.exr` files. Make sure to select `OpenEXR MultiLayer` format and set `CODEC` to None as shown in the following image. `Color Depth` can be chosen as required.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"etc/blender_cfg.png\" width=\"600\"\u003e\n\u003c/p\u003e\nWhen unsure about which channels are being written, you can inspect the file content as follows\n\n```python\nimport minexr\n\nwith open('file.exr', 'rb') as fp:\n        reader = minexr.load(fp)\n        print(reader.channel_names)\n        # ['Color.R','Color.G','Color.B', ...]\n        print(reader.attrs)\n        # Dictionary of all OpenEXR header attributes.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fpy-minexr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheind%2Fpy-minexr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fpy-minexr/lists"}