Skip to main content

Python bindings for the OpenEXR image file format

Project description

License CII Best Practices OpenSSF Scorecard Build Status Analysis Status Quality Gate Status

OpenEXR

OpenEXR provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.

The purpose of EXR format is to accurately and efficiently represent high-dynamic-range scene-linear image data and associated metadata, with strong support for multi-part, multi-channel use cases.

OpenEXR is widely used in host application software where accuracy is critical, such as photorealistic rendering, texture access, image compositing, deep compositing, and DI.

OpenEXR Project Mission

The goal of the OpenEXR project is to keep the EXR format reliable and modern and to maintain its place as the preferred image format for entertainment content creation.

Major revisions are infrequent, and new features will be carefully weighed against increased complexity. The principal priorities of the project are:

  • Robustness, reliability, security
  • Backwards compatibility, data longevity
  • Performance - read/write/compression/decompression time
  • Simplicity, ease of use, maintainability
  • Wide adoption, multi-platform support - Linux, Windows, macOS, and others

OpenEXR is intended solely for 2D data. It is not appropriate for storage of volumetric data, cached or lit 3D scenes, or more complex 3D data such as light fields.

The goals of the Imath project are simplicity, ease of use, correctness and verifiability, and breadth of adoption. Imath is not intended to be a comprehensive linear algebra or numerical analysis package.

Python Module

The OpenEXR python module provides rudimentary support for reading and writing basic scanline image data. Many features of the file format are not yet supported, including:

  • Writing of tiled images
  • Multiresoltion images
  • Deep image data
  • Some attribute types
  • Nonunity channel sampling frequencies
  • No support for interleaved channel data

Project Governance

OpenEXR is a project of the Academy Software Foundation. See the project's governance policies, contribution guidelines, and code of conduct for more information.

Quick Start

The "hello, world" image writer:

import OpenEXR

width = 10
height = 10
size = width * height

h = OpenEXR.Header(width,height)
h['channels'] = {'R' : Imath.Channel(FLOAT),
                 'G' : Imath.Channel(FLOAT),
                 'B' : Imath.Channel(FLOAT),
                 'A' : Imath.Channel(FLOAT)} 
o = OpenEXR.OutputFile("hello.exr", h)
r = array('f', [n for n in range(size*0,size*1)]).tobytes()
g = array('f', [n for n in range(size*1,size*2)]).tobytes()
b = array('f', [n for n in range(size*2,size*3)]).tobytes()
a = array('f', [n for n in range(size*3,size*4)]).tobytes()
channels = {'R' : r, 'G' : g, 'B' : b, 'A' : a}
o.writePixels(channels)
o.close()

Community

Resources

License

OpenEXR is licensed under the BSD-3-Clause license.

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

openexr-3.2.3.tar.gz (1.7 MB view hashes)

Uploaded source

Built Distributions

openexr-3.2.3-cp312-cp312-win_amd64.whl (760.2 kB view hashes)

Uploaded cp312

openexr-3.2.3-cp311-cp311-win_amd64.whl (760.0 kB view hashes)

Uploaded cp311

openexr-3.2.3-cp310-cp310-win_amd64.whl (760.0 kB view hashes)

Uploaded cp310

openexr-3.2.3-cp39-cp39-win_amd64.whl (760.1 kB view hashes)

Uploaded cp39

openexr-3.2.3-cp38-cp38-win_amd64.whl (760.1 kB view hashes)

Uploaded cp38

openexr-3.2.3-cp37-cp37m-win_amd64.whl (760.0 kB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page