tonemap

Render high dynamic range image for viewing

Syntax

RGB = tonemap(HDR)
RGB = tonemap(HDR, param1, val1, ...)

Description

RGB = tonemap(HDR) converts the high dynamic range image HDR to a lower dynamic range image, RGB, suitable for display, using a process called tone mapping. Tone mapping is a technique used to approximate the appearance of high dynamic range images on a display with a more limited dynamic range.

RGB = tonemap(HDR, param1, val1, ...) performs tone mapping where parameters control various aspects of the operation. The following table lists these parameters.

ParameterDescription
'AdjustLightness'A two-element vector in the form [low high] that specifies the overall lightness of the rendered image. low and high are luminance values of the low dynamic range image, in the range [0, 1]. These values are passed to imadjust.
'AdjustSaturation'A numeric value that specifies the saturation of colors in the rendered image. When the value is greater than 1, the colors are more saturated. When the value is in the range [0, 1) colors are less saturated.
'NumberOfTiles'A two-element vector of the form [rows cols] that specifies the number of tiles used during the adaptive histogram equalization part of the tone mapping operation. rows and cols specify the number of tile rows and columns. Both rows and cols must be at least 2. The total number of image tiles is equal to rows * cols. A larger number of tiles results in an image with greater local contrast. The default for rows and cols is 4.

Class Support

The high dynamic range image HDR must be a m-by-n-by-3 single or double array. The output image RGB is an m-by-n-by-3 uint8 image.

Examples

Load a high dynamic range image, convert it to a low dynamic range image while deepening shadows and increasing saturation, and display the results.

hdr = hdrread('office.hdr');
imshow(hdr)
rgb = tonemap(hdr, 'AdjustLightness', [0.1 1], ...
                   'AdjustSaturation', 1.5);
figure;
imshow(rgb)
Was this topic helpful?