1 Colour - HDRI¶
A Python package implementing various HDRI / Radiance image processing algorithms.
It is open source and freely available under the New BSD License terms.

Table of Contents
1.1 Features¶
The following features are available:
HDRI / Radiance Image Generation
Debevec (1997) Camera Response Function Computation
Grossberg (2003) Histogram Based Image Sampling
Variance Minimization Light Probe Sampling
Global Tonemapping Operators
Adobe DNG SDK Colour Processing
Absolute Luminance Calibration
Digital Still Camera (DSC) Exposure Model
Raw Processing Helpers
1.2 Installation¶
Because of their size, the resources dependencies needed to run the various examples and unit tests are not provided within the Pypi package. They are separately available as Git Submodules when cloning the repository.
1.2.1 Primary Dependencies¶
Colour - HDRI requires various dependencies in order to run:
1.2.2 Optional Features Dependencies¶
1.2.3 Pypi¶
Once the dependencies are satisfied, Colour - HDRI can be installed from the Python Package Index by issuing this command in a shell:
pip install --user colour-hdri
The optional features dependencies are installed as follows:
pip install --user 'colour-hdri[optional]'
The figures plotting dependencies are installed as follows:
pip install --user 'colour-hdri[plotting]'
The tests suite dependencies are installed as follows:
pip install --user 'colour-hdri[tests]'
The documentation building dependencies are installed as follows:
pip install --user 'colour-hdri[docs]'
The overall development dependencies are installed as follows:
pip install --user 'colour-hdri[development]'
1.3 Usage¶
1.3.1 API¶
The main reference for Colour - HDRI is the manual:
Colour - HDRI Manual¶
Reference¶
Colour - HDRI¶
colour_hdri
Performs absolute Luminance calibration of given RGB panoramic image using Lagarde (2016) method. |
|
Computes upper hemisphere illuminance weights for use with applications unable to perform the computation directly, i.e. Adobe Photoshop. |
colour_hdri
|
Given a set of pixel values observed for several pixels in several images with different exposure times, this function returns the imaging system’s response function \(g\) as well as the log film irradiance values \(lE\) for the observed pixels. |
Returns the camera response functions for given image stack using Debevec (1997) method. |
colour_hdri
|
Computes the average luminance \(L\) in \(cd\cdot m^{-2}\) from given relative aperture F-Number \(N\), Exposure Time \(t\), ISO arithmetic speed \(S\) and reflected light calibration constant \(k\). |
|
Computes the average illuminance \(E\) in \(Lux\) from given relative aperture F-Number \(N\), Exposure Time \(t\), ISO arithmetic speed \(S\) and incident light calibration constant \(c\). |
|
Computes the exposure value \(EV\) from given scene luminance \(L\) in \(cd\cdot m^{-2}\), ISO arithmetic speed \(S\) and reflected light calibration constant \(k\). |
|
Computes the exposure value \(EV\) from given scene illuminance \(E\) in \(Lux\), ISO arithmetic speed \(S\) and incident light calibration constant \(c\). |
|
Adjusts given array exposure using given \(EV\) exposure value. |
colour_hdri
|
Computes the focal plane exposure \(H\) in lux-seconds (\(lx.s\)). |
|
Computes the arithmetic mean focal plane exposure \(H_a\) for a camera focused on infinity, \(H_f << H\), \(T=9/10\), \(\theta =10^{\circ}\) and \(f_v=98/100\). |
Computes the Saturation-Based Speed (SBS) focal plane exposure \(H_{SBS}\) in lux-seconds (\(lx.s\)). |
|
Computes the exposure index values \(I_{EI}\) from given focal plane exposure \(H_a\). |
|
|
Computes the exposure value \(EV100\) from given relative aperture F-Number \(N\), Exposure Time \(t\) and ISO arithmetic speed \(S\). |
Converts the exposure value \(EV100\) to photometric exposure scale factor using Lagarde and de Rousiers (2014) formulation derived from the ISO 12232:2006 Saturation Based Sensitivity (SBS) recommendation. |
colour_hdri
|
Generates a HDRI / radiance image from given image stack. |
colour_hdri
|
Returns given array weighted by a normal distribution function. |
|
Returns given array weighted by a hat function. |
|
Returns given array weighted by Debevec (1997) function. |
colour_hdri
|
Converts given xy white balance chromaticity coordinates to Camera Neutral coordinates. |
|
Converts given Camera Neutral coordinates to xy white balance chromaticity coordinates. |
|
Returns the CIE XYZ to Camera Space matrix for given xy white balance chromaticity coordinates. |
|
Returns the Camera Space to CIE XYZ matrix for given xy white balance chromaticity coordinates. |
colour_hdri
|
Converts given RGB array from camera space to given RGB colourspace. |
|
Converts given RGB array from camera space to sRGB colourspace. |
colour_hdri.plotting
|
Plots given HDRI / radiance image as strip of images of varying exposure. |
colour_hdri.plotting
|
Plots given tonemapped image with superimposed luminance mapping function. |
colour_hdri
|
Converts given raw files to dng files using given output directory. |
Command line raw conversion application, usually Dave Coffin’s dcraw. |
|
Arguments for the command line raw conversion application for non demosaiced linear tiff file format output. |
|
Arguments for the command line raw conversion application for demosaiced linear tiff file format output. |
colour_hdri
Converts given dng files to intermediate tiff files using given output directory. |
|
Arguments for the command line dng conversion application. |
|
Exif tags binding for a dng file. |
|
|
Reads given dng files exif tags using given binding. |
colour_hdri
|
Performs highlights recovery using Coffin (1997) method from dcraw. |
|
Performs highlights recovery in CIE L*C*Hab colourspace. |
colour_hdri
|
Sample given light probe to find lights using Viriyothai (2009) variance minimization light probe sampling algorithm. |
colour_hdri
|
Returns the samples for given image stack intensity histograms using Grossberg (2003) method. |
colour_hdri
Performs given RGB array tonemapping using the simple method: \(\cfrac{RGB}{RGB + 1}\). |
colour_hdri
|
Performs given RGB array tonemapping using the normalisation method. |
colour_hdri
|
Performs given RGB array tonemapping using the gamma and exposure correction method. |
colour_hdri
|
Performs given RGB array tonemapping using the logarithmic method. |
|
Performs given RGB array tonemapping using the exponential method. |
Performs given RGB array tonemapping using the logarithmic mapping method. |
|
Performs given RGB array tonemapping using the exponentiation mapping method. |
|
|
Performs given RGB array tonemapping using Schlick (1994) method. |
|
Performs given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
|
Performs given RGB array tonemapping using Reinhard and Devlin (2004) method. |
|
Performs given RGB array tonemapping using Habble (2010) method. |
colour_hdri
Performs given RGB array tonemapping using the logarithmic mapping method. |
colour_hdri
|
Performs given RGB array tonemapping using the exponential method. |
colour_hdri
Performs given RGB array tonemapping using the exponentiation mapping method. |
|
|
Performs given RGB array tonemapping using Schlick (1994) method. |
|
Performs given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
|
Performs given RGB array tonemapping using Reinhard and Devlin (2004) method. |
|
Performs given RGB array tonemapping using Habble (2010) method. |
colour_hdri
|
Performs given RGB array tonemapping using Schlick (1994) method. |
colour_hdri
|
Performs given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
colour_hdri
|
Performs given RGB array tonemapping using Reinhard and Devlin (2004) method. |
colour_hdri
|
Performs given RGB array tonemapping using Habble (2010) method. |
colour_hdri
Implements supports for vivification of the underlying dict like data-structure, magical! |
|
|
Converts given vivified data-structure to dictionary. |
|
Returns if given path exists. |
|
Filters given directory for files matching given extensions. |
colour_hdri
Command line exif manipulation application, usually Phil Harvey’s ExifTool. |
|
|
Hunt colour appearance model induction factors. |
|
Parses given exif tag assuming it is a string and return its value. |
|
Parses given exif tag assuming it is a numeric type and return its value. |
|
Parses given exif tag assuming it is a fraction and return its value. |
|
Parses given exif tag assuming it is an array and return its value. |
|
Parses given exif data output from exiftool. |
|
Returns given image exif image tags. |
|
Copies given source image file exif tag to given image target. |
|
Updates given images siblings images pairs exif tags. |
|
Deletes all given image exif tags. |
|
Returns given image exif tag value. |
|
Sets given image exif tag value. |
colour_hdri
|
Defines the base object for storing exif metadata relevant to HDRI / radiance image generation. |
|
Defines the base object for storing an image along its path, pixel data and metadata needed for HDRI / radiance images generation. |
Defines a convenient stack storing a sequence of images for HDRI / radiance images generation. |
Indices and tables¶
Bibliography¶
- BADC11a
Francesco Banterle, Alessandro Artusi, Kurt Debattista, and Alan Chalmers. 2.1.1 Generating HDR Content by Combining Multiple Exposures. A K Peters/CRC Press, 2011. ISBN 978-1-56881-719-4.
- BADC11b
Francesco Banterle, Alessandro Artusi, Kurt Debattista, and Alan Chalmers. 3.2.1 simple mapping methods. In Advanced High Dynamic Range Imaging, pages 38–41. A K Peters/CRC Press, 2011.
- BB14
Francesco Banterle and Luca Benedetti. Piccante: an open and portable library for hdr imaging. 2014.
- Cof15
Dave Coffin. Dcraw. 2015. URL: https://www.cybercom.net/~dcoffin/dcraw/.
- DM97
Paul E. Debevec and Jitendra Malik. Recovering high dynamic range radiance maps from photographs. In Proceedings of the 24th annual conference on Computer graphics and interactive techniques - SIGGRAPH ‘97, 369–378. New York, New York, USA, 1997. ACM Press. doi:10.1145/258734.258884.
- GN03
M.D. Grossberg and S.K. Nayar. Determining the camera response from images: what is knowable? IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(11):1455–1467, November 2003. doi:10.1109/TPAMI.2003.1240119.
- Hab10a
John Habble. Filmic tonemapping operators. 2010. URL: http://filmicgames.com/archives/75.
- Hab10b
John Habble. Uncharted 2: hdr lighting. 2010. URL: http://www.slideshare.net/ozlael/hable-john-uncharted2-hdr-lighting.
- LLJ16
Sebastien Lagarde, Sebastien Lachambre, and Cyril Jover. An artist-friendly workflow for panoramic hdri. 2016. URL: http://blog.selfshadow.com/publications/s2016-shading-course/unity/s2016_pbs_unity_hdri_notes.pdf.
- LdeRousiers14
Sébastian Lagarde and Charles de Rousiers. Moving frostbite to physically based rendering 3.0. Siggraph 2014, pages 119, 2014.
- McG12
Sandy McGuffog. Hue twists in dng camera profiles. 2012. URL: http://dcptool.sourceforge.net/Hue\%20Twists.html.
- RD05
Erik Reinhard and Kate Devlin. Dynamic range reduction inspired by photoreceptor physiology. IEEE Transactions on Visualization and Computer Graphics, 11(01):13–24, January 2005. doi:10.1109/TVCG.2005.9.
- Sch94
Christophe Schlick. Quantization techniques for visualization of high dynamic range pictures. Proceedings of the Fifth Eurographics Workshop on Rendering, pages 7–18, 1994.
- THG99
Jack Tumblin, Jessica K. Hodgins, and Brian K. Guenter. Two methods for display of high contrast images. ACM Transactions on Graphics, 18(1):56–94, January 1999. doi:10.1145/300776.300783.
- VD09
Kuntee Viriyothai and Paul Debevec. Variance minimization light probe sampling. In SIGGRAPH ‘09: Posters on - SIGGRAPH ‘09, 1–1. New York, New York, USA, 2009. ACM Press. doi:10.1145/1599301.1599393.
- AdobeSystems12a
Adobe Systems. Camera to xyz (d50) transform. In Digital Negative (DNG) Specification, pages 81. 2012.
- AdobeSystems12b
Adobe Systems. Digital negative (dng) specification. 2012.
- AdobeSystems12c
Adobe Systems. Translating camera neutral coordinates to white balance xy coordinates. In Digital Negative (DNG) Specification, pages 80–81. 2012.
- AdobeSystems12d
Adobe Systems. Translating white balance xy coordinates to camera neutral coordinates. In Digital Negative (DNG) Specification, pages 80. 2012.
- AdobeSystems15a
Adobe Systems. Adobe dng sdk 1.4. 2015. URL: http://download.adobe.com/pub/adobe/dng/dng_sdk_1_4.zip.
- AdobeSystems15b
Adobe Systems. Adobe dng sdk 1.4 - dng_sdk_1_4/dng_sdk/source/dng_camera_profile.cpp - dng_camera_profile::illuminanttotemperature. 2015. URL: http://download.adobe.com/pub/adobe/dng/dng_sdk_1_4.zip.
- AdobeSystems15c
Adobe Systems. Adobe dng sdk 1.4 - dng_sdk_1_4/dng_sdk/source/dng_tag_values.h - lightsource tag. 2015. URL: http://download.adobe.com/pub/adobe/dng/dng_sdk_1_4.zip.
- ISO06
ISO. International standard iso12232-2006 - photography - digital still cameras - determination of exposure index, iso speed ratings, standard output sensitivity, and recommended exposure index. 2006.
- Wikipediaa
Wikipedia. Ev as a measure of luminance and illuminance. URL: https://en.wikipedia.org/wiki/Exposure_value\#EV_as_a_measure_of_luminance_and_illuminance.
- Wikipediab
Wikipedia. Tonemapping - purpose and methods. URL: http://en.wikipedia.org/wiki/Tone_mapping\#Purpose_and_methods.
Indirect References¶
Some extra references used in the codebase but not directly part of the public api:
1.3.2 Examples¶
Various usage examples are available from the examples directory.
1.4 Contributing¶
If you would like to contribute to Colour - HDRI, please refer to the following Contributing guide for Colour.
1.6 Code of Conduct¶
The Code of Conduct, adapted from the Contributor Covenant 1.4, is available on the Code of Conduct page.