1 Colour - HDRI#
A Python package implementing various HDRI processing algorithms.
It is open source and freely available under the BSD-3-Clause terms.

1.1 Features#
The following features are available:
HDRI 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
Vignette Characterisation & Correction
1.1.1 Examples#
Various usage examples are available from the examples directory.
1.2 User Guide#
User Guide#
The user guide provides an overview of Colour - HDRI and explains important concepts and features, details can be found in the API Reference.
Installation Guide#
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.
Primary Dependencies#
Colour - HDRI requires various dependencies in order to run:
Optional Features Dependencies#
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 overall development dependencies are installed as follows:
pip install --user 'colour-hdri[development]'
Bibliography#
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.
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.
Francesco Banterle and Luca Benedetti. PICCANTE: An Open and Portable Library for HDR Imaging. 2014.
Dave Coffin. Dcraw. 2015.
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, number August, 369–378. New York, New York, USA, 1997. ACM Press. doi:10.1145/258734.258884.
Michael D. Grossberg and Shree K. Nayar. Determining the camera response from images: What is knowable? IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(11):1455–1467, 2003. doi:10.1109/TPAMI.2003.1240119.
John Habble. Filmic Tonemapping Operators. http://filmicgames.com/archives/75, 2010.
John Habble. Uncharted 2: HDR Lighting. http://www.slideshare.net/ozlael/hable-john-uncharted2-hdr-lighting, 2010.
Andrzej Kordecki, Henryk Palus, and Artur Bal. Practical vignetting correction method for digital camera with measurement of surface luminance distribution. Signal, Image and Video Processing, 10(8):1417–1424, November 2016. doi:10.1007/s11760-016-0941-2.
Sebastien Lagarde, Sebastien Lachambre, and Cyril Jover. An Artist-Friendly Workflow for Panoramic HDRI. 2016.
Sébastian Lagarde and Charles de Rousiers. Moving Frostbite to Physically Based Rendering 3.0. Siggraph 2014, pages 119, 2014.
Sandy McGuffog. Hue Twists in DNG Camera Profiles. http://dcptool.sourceforge.net/Hue%20Twists.html, 2012.
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.
Christophe Schlick. Quantization Techniques for Visualization of High Dynamic Range Pictures. Proceedings of the Fifth Eurographics Workshop on Rendering, pages 7–18, 1994.
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.
Kuntee Viriyothai and Paul Debevec. Variance minimization light probe sampling. In SIGGRAPH '09: Posters on - SIGGRAPH '09, number Egsr, 1–1. New York, New York, USA, 2009. ACM Press. doi:10.1145/1599301.1599393.
Adobe Systems. Camera to XYZ (D50) Transform. In Digital Negative (DNG) Specification, pages 81. 2012.
Adobe Systems. Digital Negative (DNG) Specification. 2012.
Adobe Systems. Translating Camera Neutral Coordinates to White Balance xy Coordinates. In Digital Negative (DNG) Specification, pages 80–81. 2012.
Adobe Systems. Translating White Balance xy Coordinates to Camera Neutral Coordinates. In Digital Negative (DNG) Specification, pages 80. 2012.
Adobe Systems. Adobe DNG SDK 1.4. 2015.
Adobe Systems. Adobe DNG SDK 1.4 - dng_sdk_1_4/dng_sdk/source/dng_camera_profile.cpp - dng_camera_profile::IlluminantToTemperature. 2015.
Adobe Systems. Adobe DNG SDK 1.4 - dng_sdk_1_4/dng_sdk/source/dng_tag_values.h - LightSource tag. 2015.
ISO. INTERNATIONAL STANDARD ISO12232-2006 - Photography - Digital still cameras - Determination of exposure index, ISO speed ratings, standard output sensitivity, and recommended exposure index. 2006.
Wikipedia. Tonemapping - Purpose and methods. http://en.wikipedia.org/wiki/Tone_mapping#Purpose_and_methods.
Wikipedia. EV as a measure of luminance and illuminance. https://en.wikipedia.org/wiki/Exposure_value#EV_as_a_measure_of_luminance_and_illuminance.
Wonpil Yu. Practical anti-vignetting methods for digital cameras. IEEE Transactions on Consumer Electronics, 50(4):975–983, November 2004. doi:10.1109/TCE.2004.1362487.
Indirect References#
Some extra references used in the codebase but not directly part of the public api:
1.3 API Reference#
API Reference#
Colour - HDRI#
Camera Calibration#
Absolute Luminance - Lagarde (2016)#
colour_hdri
Perform absolute Luminance calibration of given RGB panoramic image using Lagarde (2016) method. |
|
Compute upper hemisphere illuminance weights for use with applications unable to perform the computation directly, i.e. Adobe Photoshop. |
Debevec (1997)#
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. |
|
Return the camera response functions for given image stack using Debevec (1997) method. |
Exposure Computation#
Common#
colour_hdri
|
Compute 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\). |
|
Compute 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\). |
|
Compute the exposure value \(EV\) from given scene luminance \(L\) in \(cd\cdot m^{-2}\), ISO arithmetic speed \(S\) and reflected light calibration constant \(k\). |
|
Compute the exposure value \(EV\) from given scene illuminance \(E\) in \(Lux\), ISO arithmetic speed \(S\) and incident light calibration constant \(c\). |
|
Adjust given array exposure using given \(EV\) exposure value. |
Digital Still Camera Exposure#
colour_hdri
|
Compute the focal plane exposure \(H\) in lux-seconds (\(lx.s\)). |
|
Compute 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\). |
Compute the Saturation-Based Speed (SBS) focal plane exposure \(H_{SBS}\) in lux-seconds (\(lx.s\)). |
|
Compute the exposure index values \(I_{EI}\) from given focal plane exposure \(H_a\). |
|
|
Compute the exposure value \(EV100\) from given relative aperture F-Number \(N\), Exposure Time \(t\) and ISO arithmetic speed \(S\). |
Convert 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. |
HDRI Generation#
Generation#
colour_hdri
|
Generate a HDRI from given image stack. |
Weighting Functions#
colour_hdri
|
Return given array weighted by a normal distribution function. |
|
Return given array weighted by a hat function. |
|
Return given array weighted by Debevec (1997) function. |
Colour Models#
Adobe DNG SDK#
colour_hdri
|
Convert given xy white balance chromaticity coordinates to Camera Neutral coordinates. |
|
Convert given Camera Neutral coordinates to xy white balance chromaticity coordinates. |
|
Return the CIE XYZ to Camera Space matrix for given xy white balance chromaticity coordinates. |
|
Return the Camera Space to CIE XYZ matrix for given xy white balance chromaticity coordinates. |
RGB Models#
colour_hdri
|
Convert given RGB array from camera space to given RGB colourspace. |
|
Convert given RGB array from camera space to sRGB colourspace. |
Plotting#
HDRI#
colour_hdri.plotting
|
Plot given HDRI as strip of images of varying exposure. |
Tonemapping Operators#
colour_hdri.plotting
|
Plot given tonemapped image with superimposed luminance mapping function. |
Image Processing#
Adobe DNG SDK#
Raw Files#
colour_hdri
|
Convert given raw files to dng files using given output directory. |
Command line raw conversion application, typically 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. |
DNG Files#
colour_hdri
Convert given dng files to intermediate tiff files using given output directory. |
|
Command line DNG conversion application, typically Adobe DNG Converter. |
|
Arguments for the command line DNG conversion application. |
|
Exif tags binding for a dng file. |
|
|
Read given dng files exif tags using given binding. |
Highlights Recovery#
Clipped Highlights Recovery#
colour_hdri
|
Perform highlights recovery using Coffin (1997) method from dcraw. |
|
Perform highlights recovery in CIE L*C*Hab colourspace. |
Image Sampling#
Viriyothai (2009)#
colour_hdri
|
Sample given light probe to find lights using Viriyothai (2009) variance minimization light probe sampling algorithm. |
Grossberg (2013)#
colour_hdri
|
Return the samples for given image stack intensity histograms using Grossberg (2003) method. |
Tonemapping Operators#
Global#
Simple#
colour_hdri
Perform given RGB array tonemapping using the simple method: \(\cfrac{RGB}{RGB + 1}\). |
Normalisation#
colour_hdri
|
Perform given RGB array tonemapping using the normalisation method. |
Gamma#
colour_hdri
|
Perform given RGB array tonemapping using the gamma and exposure correction method. |
Logarithmic#
colour_hdri
|
Perform given RGB array tonemapping using the logarithmic method. |
|
Perform given RGB array tonemapping using the exponential method. |
Perform given RGB array tonemapping using the logarithmic mapping method. |
|
Perform given RGB array tonemapping using the exponentiation mapping method. |
|
|
Perform given RGB array tonemapping using Schlick (1994) method. |
|
Perform given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
|
Perform given RGB array tonemapping using Reinhard and Devlin (2004) method. |
|
Perform given RGB array tonemapping using Habble (2010) method. |
Logarithmic Mapping#
colour_hdri
Perform given RGB array tonemapping using the logarithmic mapping method. |
Exponential#
colour_hdri
|
Perform given RGB array tonemapping using the exponential method. |
Exponentiation Mapping#
colour_hdri
Perform given RGB array tonemapping using the exponentiation mapping method. |
|
|
Perform given RGB array tonemapping using Schlick (1994) method. |
|
Perform given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
|
Perform given RGB array tonemapping using Reinhard and Devlin (2004) method. |
|
Perform given RGB array tonemapping using Habble (2010) method. |
Schlick (1994)#
colour_hdri
|
Perform given RGB array tonemapping using Schlick (1994) method. |
Tumblin, Hodgins and Guenter (1999)#
colour_hdri
|
Perform given RGB array tonemapping using Tumblin, Hodgins and Guenter (1999) method. |
Reinhard and Devlin (2004)#
colour_hdri
|
Perform given RGB array tonemapping using Reinhard and Devlin (2004) method. |
Habble (2010) - Filmic#
colour_hdri
|
Perform given RGB array tonemapping using Habble (2010) method. |
Utilities#
Common#
colour_hdri
Implement supports for vivification of the underlying dict like data-structure, magical! |
|
|
Convert given vivified data-structure to dictionary. |
|
Return whether given path exists. |
|
Filter given directory for files matching given extensions. |
EXIF Data Manipulation#
colour_hdri
Command line EXIF manipulation application, usually Phil Harvey's ExifTool. |
|
|
EXIF tag data. |
|
Parse given EXIF tag assuming it is a string and return its value. |
|
Parse given EXIF tag assuming it is a number type and return its value. |
|
Parse given EXIF tag assuming it is a fraction and return its value. |
|
Parse given EXIF tag assuming it is an array and return its value. |
|
Parse given EXIF data output from exiftool. |
|
Return given image EXIF image tags. |
|
Copy given source image file EXIF tag to given image target. |
|
Update given images pairs EXIF tags. |
|
Delete all given image EXIF tags. |
|
Return given image EXIF tag value. |
|
Set given image EXIF tag value. |
Image Data & Metadata Utilities#
colour_hdri
|
Define the base object for storing exif metadata relevant to HDRI Generation. |
|
Define the base object for storing an image along its path, pixel data and metadata needed for HDRIs generation. |
Define a convenient stack storing a sequence of images for HDRI / radiance images generation. |
Indices and tables#
1.4 See Also#
1.4.1 Publications#
Advanced High Dynamic Range Imaging: Theory and Practice by Banterle, F. et al.
Advanced High Dynamic Range Imaging: Theory and Practice was used as a reference for some of the algorithms of Colour - HDRI.
1.4.2 Software#
C/C++
Piccante was used to verify the Grossberg (2003) Histogram Based Image Sampling.
Matlab
HDR Toolbox by Banterle, F. et al.
1.5 Code of Conduct#
The Code of Conduct, adapted from the Contributor Covenant 1.4, is available on the Code of Conduct page.