Tone mapping
Encyclopedia
Tone mapping is a technique used in image processing
and computer graphics
to map one set of colors to another in order to approximate the appearance of high dynamic range images in a medium that has a more limited dynamic range
. Print-outs, CRT or LCD monitors, and projectors all have a limited dynamic range that is inadequate to reproduce the full range of light intensities present in natural scenes. Essentially, tone mapping addresses the problem of strong contrast reduction from the scene values (radiance
) to the displayable range while preserving the image details and color appearance important to appreciate the original scene content.
Various tone mapping operators have been developed in the recent years . They all can be divided in two main types:
A simple example of global tone mapping filter is . This function will map scene radiance values Y in the domain to a displayable output range of . Global tone mapping can be done very fast and in a very flexible way.
A more sophisticated group of tone mapping algorithms is based on contrast or gradient domain methods, which are 'local'. Such operators concentrate on preserving contrast between neighboring regions rather than absolute value, an approach motivated by the fact that the human perception is most sensitive to contrast in images rather than absolute intensities. Those tone mapping methods usually produce very sharp images, which preserve very well small contrast details; however, this is often done at the cost of flattening an overall image contrast. Examples of such tone mapping methods include: gradient domain high dynamic range compression and A Perceptual Framework for Contrast Processing of High Dynamic Range Images (a tone mapping is one of the applications of this framework).
An interesting approach to tone mapping of HDR images is inspired by the anchoring theory of lightness perception . This theory explains many characteristics of the human visual system such as lightness constancy and its failures (as in the checker shadow illusion), which are important in the perception of images. The key concept of this tone mapping method (Lightness Perception in Tone Reproduction) is a decomposition of an HDR image into areas (frameworks) of consistent illumination and the local calculation of the lightness values. The net lightness of an image is calculated by merging of the frameworks proportionally to their strength. Particularly important is the anchoring—relating the luminance values to a known brightness value, namely estimating which luminance value is perceived as white in the scene. This approach to tone mapping does not affect the local contrast and preserves the natural colors of an HDR image due to the linear handling of luminance.
One simple form of tone mapping takes a standard image (not HDR – the dynamic range already compressed) and applies unsharp masking
with a large radius, which increases local contrast rather than sharpening. See unsharp masking: local contrast enhancement for details.
, as described in his book The Print; see also his Zone System
.
The normal process of exposure compensation
, brightening shadows and altering contrast applied globally to digital images as part of a professional or serious amateur workflow is also a form of tone mapping.
However, HDR tone mapping, usually using local operators, has become increasingly popular amongst digital photographers as a post-processing technique, where several exposures at different shutter speeds are combined to produce an HDR image and a tone mapping operator is then applied to the result. There are now many examples of locally tone mapped digital images, inaccurately known as "HDR photographs", on the internet, and these are of varying quality. This popularity is partly driven by the distinctive appearance of locally tone mapped images, which many people find attractive, and partly by a desire to capture high-contrast scenes that are hard or impossible to photograph in a single exposure, and may not render attractively even when they can be captured. Although digital sensors actually capture a higher dynamic range than film, they completely lose detail in extreme highlights, clipping them to pure white, producing an unattractive result when compared with negative film, which tends to retain colour and some detail in highlights.
In some cases local tone mapping is used even though the dynamic range of the source image could be captured on the target media, either to produce the distinctive appearance of a locally tone mapped image, or to produce an image closer to the photographer's artistic vision of the scene by removing sharp contrasts, which often look unattractive. In some cases, tone mapped images are produced from a single exposure which is then manipulated with conventional processing tools to produce the inputs to the HDR image generation process. This avoids the artifacts that can appear when different exposures are combined, due to moving objects in the scene or camera shake. However, when tone mapping is applied to a single exposure in this way, the intermediate image has only normal dynamic range, and the amount of shadow or highlight detail that can be rendered is only that which was captured in the original exposure.
images.
In the ideal case, a camera might measure luminance
directly and store this in the HDR image; however, most high dynamic range images produced by cameras today are not calibrated or even proportional to luminance, due to practical reasons such as cost and time required to measure accurate luminance values — it is often sufficient for artists to use multiple exposures to gain an "HDR image" which grossly approximates the true luminance signal.
The high dynamic range image is passed to a tone mapping operator, in this case a non-local operator, which transforms the image into a low dynamic range image suitable for viewing on a monitor. Relative to the church interior, the stained-glass window is displayed at a much lower brightness than a linear mapping between scene radiance and pixel intensity would produce. However, this inaccuracy is perceptually less important than the image detail, which can now be shown in both the window and the church interior simultaneously.
Not all tone mapped images are visually distinctive. Reducing dynamic range with tone mapping is often useful in bright sunlit scenes, where the difference in intensity between direct illumination and shadow is great. In these cases the global contrast of the scene is reduced, but the local contrast maintained, while the image as a whole continues to look natural. Use of tone mapping in this context may not be apparent from the final image:
Tone mapping can also produce distinctive visual effects in the final image, such as the visible halo around the tower in the Cornell Law School image below. It can be used to produce these effects even when the dynamic range of the original image is not particularly high. Halos in images come about because the local tone mapping operator will brighten areas around dark objects, in order to maintain the local contrast in the original image, which fools the human visual system into perceiving the dark objects as being dark, even if their actual luminance is the same as that of areas of the image perceived as being bright. Usually this effect is subtle, but if the contrasts in the original image are extreme, or the photographer deliberately sets the luminance gradient to be very steep, the halos become visible.
Image processing
In electrical engineering and computer science, image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image...
and computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....
to map one set of colors to another in order to approximate the appearance of high dynamic range images in a medium that has a more limited dynamic range
Dynamic range
Dynamic range, abbreviated DR or DNR, is the ratio between the largest and smallest possible values of a changeable quantity, such as in sound and light. It is measured as a ratio, or as a base-10 or base-2 logarithmic value.-Dynamic range and human perception:The human senses of sight and...
. Print-outs, CRT or LCD monitors, and projectors all have a limited dynamic range that is inadequate to reproduce the full range of light intensities present in natural scenes. Essentially, tone mapping addresses the problem of strong contrast reduction from the scene values (radiance
Radiance
Radiance and spectral radiance are radiometric measures that describe the amount of radiation such as light or radiant heat that passes through or is emitted from a particular area, and falls within a given solid angle in a specified direction. They are used to characterize both emission from...
) to the displayable range while preserving the image details and color appearance important to appreciate the original scene content.
Purpose and methods
The goals of tone mapping can be differently stated depending on the particular application. In some cases producing just aesthetically pleasing images is the main goal, while other applications might emphasize reproducing as many image details as possible, or maximizing the image contrast. The goal in realistic rendering applications might be to obtain a perceptual match between a real scene and a displayed image even though the display device is not able to reproduce the full range of luminance values.Various tone mapping operators have been developed in the recent years . They all can be divided in two main types:
- global (or spatially uniform) operators: they are non-linear functions based on the luminance and other global variables of the image. Once the optimal function has been estimated according to the particular image, every pixel in the image is mapped in the same way, independent of the value of surrounding pixels in the image. Those techniques are simple and fast (since they can be implemented using look-up-tables), but they can cause a loss of contrast. Examples of common global tone mapping methods are contrast reduction and negative.
- local (or spatially varying) operators: the parameters of the non-linear function change in each pixel, according to features extracted from the surrounding parameters. In other words, the effect of the algorithm changes in each pixel according to the local features of the image. Those algorithms are more complicated than the global ones, they can show artifacts (e.g. halo effect and ringing), the output can look un-realistic, but they can provide the best performance, since the human vision is mainly sensitive to local contrast.
A simple example of global tone mapping filter is . This function will map scene radiance values Y in the domain to a displayable output range of . Global tone mapping can be done very fast and in a very flexible way.
A more sophisticated group of tone mapping algorithms is based on contrast or gradient domain methods, which are 'local'. Such operators concentrate on preserving contrast between neighboring regions rather than absolute value, an approach motivated by the fact that the human perception is most sensitive to contrast in images rather than absolute intensities. Those tone mapping methods usually produce very sharp images, which preserve very well small contrast details; however, this is often done at the cost of flattening an overall image contrast. Examples of such tone mapping methods include: gradient domain high dynamic range compression and A Perceptual Framework for Contrast Processing of High Dynamic Range Images (a tone mapping is one of the applications of this framework).
An interesting approach to tone mapping of HDR images is inspired by the anchoring theory of lightness perception . This theory explains many characteristics of the human visual system such as lightness constancy and its failures (as in the checker shadow illusion), which are important in the perception of images. The key concept of this tone mapping method (Lightness Perception in Tone Reproduction) is a decomposition of an HDR image into areas (frameworks) of consistent illumination and the local calculation of the lightness values. The net lightness of an image is calculated by merging of the frameworks proportionally to their strength. Particularly important is the anchoring—relating the luminance values to a known brightness value, namely estimating which luminance value is perceived as white in the scene. This approach to tone mapping does not affect the local contrast and preserves the natural colors of an HDR image due to the linear handling of luminance.
One simple form of tone mapping takes a standard image (not HDR – the dynamic range already compressed) and applies unsharp masking
Unsharp masking
Unsharp masking is an image manipulation technique, often available in digital image processing software.The "unsharp" of the name derives from the fact that the technique uses a blurred, or "unsharp," positive to create a "mask" of the original image...
with a large radius, which increases local contrast rather than sharpening. See unsharp masking: local contrast enhancement for details.
Tone mapping in digital photography
Forms of tone mapping long precede digital photography. The manipulation of film and development process to render high contrast scenes, especially those shot in bright sunlight, on printing paper with a relatively low dynamic range, is effectively a form of tone mapping, although it is not usually called that. Local adjustment of tonality in film processing is primarily done via dodging and burning, and is particularly advocated by and associated with Ansel AdamsAnsel Adams
Ansel Easton Adams was an American photographer and environmentalist, best known for his black-and-white photographs of the American West, especially in Yosemite National Park....
, as described in his book The Print; see also his Zone System
Zone system
The Zone System is a photographic technique for determining optimal film exposure and development, formulated by Ansel Adams and Fred Archer. Adams described how the Zone System was developed: "I take this opportunity to restate that the Zone System is not an invention of mine; it is a codification...
.
The normal process of exposure compensation
Exposure compensation
Exposure compensation is a technique for adjusting the exposure indicated by a photographic exposure meter, in consideration of factors that may cause the indicated exposure to result in a less-than-optimal image. Factors considered may include unusual lighting distribution, variations within a...
, brightening shadows and altering contrast applied globally to digital images as part of a professional or serious amateur workflow is also a form of tone mapping.
However, HDR tone mapping, usually using local operators, has become increasingly popular amongst digital photographers as a post-processing technique, where several exposures at different shutter speeds are combined to produce an HDR image and a tone mapping operator is then applied to the result. There are now many examples of locally tone mapped digital images, inaccurately known as "HDR photographs", on the internet, and these are of varying quality. This popularity is partly driven by the distinctive appearance of locally tone mapped images, which many people find attractive, and partly by a desire to capture high-contrast scenes that are hard or impossible to photograph in a single exposure, and may not render attractively even when they can be captured. Although digital sensors actually capture a higher dynamic range than film, they completely lose detail in extreme highlights, clipping them to pure white, producing an unattractive result when compared with negative film, which tends to retain colour and some detail in highlights.
In some cases local tone mapping is used even though the dynamic range of the source image could be captured on the target media, either to produce the distinctive appearance of a locally tone mapped image, or to produce an image closer to the photographer's artistic vision of the scene by removing sharp contrasts, which often look unattractive. In some cases, tone mapped images are produced from a single exposure which is then manipulated with conventional processing tools to produce the inputs to the HDR image generation process. This avoids the artifacts that can appear when different exposures are combined, due to moving objects in the scene or camera shake. However, when tone mapping is applied to a single exposure in this way, the intermediate image has only normal dynamic range, and the amount of shadow or highlight detail that can be rendered is only that which was captured in the original exposure.
Example of the imaging process
The images on the right show the interior of a church, a scene which has a variation in radiance much larger than that which can be displayed on a monitor or recorded by a conventional camera. The six individual exposures from the camera show the radiance of the scene in some range transformed to the range of brightnesses that can be displayed on a monitor. The range of radiances recorded in each photo is limited, so not all details can be displayed at once: for example, details of the dark church interior cannot be displayed at the same time as those of the bright stained-glass window. An algorithm is applied to the six images to recreate the high dynamic range radiance map of the original scene (a high dynamic range image). Alternatively, some higher-end consumer and specialist scientific digital cameras are able to record a high dynamic range image directly, for example with RAWRAW image format
A camera raw image file contains minimally processed data from the image sensor of either a digital camera, image scanner, or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited with a bitmap graphics editor...
images.
In the ideal case, a camera might measure luminance
Luminance
Luminance is a photometric measure of the luminous intensity per unit area of light travelling in a given direction. It describes the amount of light that passes through or is emitted from a particular area, and falls within a given solid angle. The SI unit for luminance is candela per square...
directly and store this in the HDR image; however, most high dynamic range images produced by cameras today are not calibrated or even proportional to luminance, due to practical reasons such as cost and time required to measure accurate luminance values — it is often sufficient for artists to use multiple exposures to gain an "HDR image" which grossly approximates the true luminance signal.
The high dynamic range image is passed to a tone mapping operator, in this case a non-local operator, which transforms the image into a low dynamic range image suitable for viewing on a monitor. Relative to the church interior, the stained-glass window is displayed at a much lower brightness than a linear mapping between scene radiance and pixel intensity would produce. However, this inaccuracy is perceptually less important than the image detail, which can now be shown in both the window and the church interior simultaneously.
Visual effect
Local tone mapping produces a number of characteristic effects in images. These include halos around dark objects, a "painting-like" or "cartoon-like" appearance due to a lack of large global contrasts, and highly saturated colours. Many people find the resulting images attractive and these effects to add an interesting new set of choices for post-processing in digital photography. Some people believe that the results stray too far from realism, or find them unattractive, but these are aesthetic judgements, and often concern the choices made by the photographer during the tone mapping process, rather than being a necessary consequence of using tone mapping.Not all tone mapped images are visually distinctive. Reducing dynamic range with tone mapping is often useful in bright sunlit scenes, where the difference in intensity between direct illumination and shadow is great. In these cases the global contrast of the scene is reduced, but the local contrast maintained, while the image as a whole continues to look natural. Use of tone mapping in this context may not be apparent from the final image:
Tone mapping can also produce distinctive visual effects in the final image, such as the visible halo around the tower in the Cornell Law School image below. It can be used to produce these effects even when the dynamic range of the original image is not particularly high. Halos in images come about because the local tone mapping operator will brighten areas around dark objects, in order to maintain the local contrast in the original image, which fools the human visual system into perceiving the dark objects as being dark, even if their actual luminance is the same as that of areas of the image perceived as being bright. Usually this effect is subtle, but if the contrasts in the original image are extreme, or the photographer deliberately sets the luminance gradient to be very steep, the halos become visible.
External links
- CVLTonemap: GPU accelerated tone mapping
- HDR Darkroom
- pfstmo: implementation of tone mapping operators
- exrtools: a collection of utilities for manipulating OpenEXR images (includes some tone mapping operators)
- pfstools is an open-source set of command line programs for reading, writing and manipulating high-dynamic range (HDR) images and video frames
- Luminance HDR/QtPfsGui is a free (open-source) HDR-workflow software for Linux, Windows and Mac OS X based around the pfstools package
- LDR tonemapping is a free (open-source) tonemapper for low dynamic range images (a.k.a. "pseudo-HDR")
- Atlas is a free (open-source) port of the pfstmo tone mapping operators to Adobe After EffectsAdobe After EffectsAdobe After Effects is a digital motion graphics and compositing software published by Adobe Systems, used in the post-production process of filmmaking and television production. Its main uses are the origination of 2D and 2.5D animation, visual effects compositing and finishing...
- Flickr HDR pool, a collection of surreal tone mappings
- UC Berkeley paper with raw data for Purkinje effect
- Stuck in Customs, an extensive tutorial to make HDR images
Tone mapping algorithms
- Perceptually Based Tone Mapping for Low-Light Conditions
- Photographic Tone Reproduction for Digital Images
- Lightness Perception in Tone Reproduction for High Dynamic Range Images
- Contrast Processing of High Dynamic Range Images
- Fast Bilateral Filtering for the Display of High-Dynamic-Range Images
- A Fast Approximation of the Bilateral Filter using a Signal Processing Approach
- Gradient Domain High Dynamic Range Compression