Main Content

Display High Dynamic Range Image

This example shows how to display a high dynamic range (HDR) image. To view an HDR image, you must first convert the data to a dynamic range that can be displayed correctly on a computer.

Read a high dynamic range (HDR) image using hdrread. If you try to display the HDR image, notice that it does not display correctly.

hdr_image = hdrread("office.hdr");
imshow(hdr_image)

Figure contains an axes object. The hidden axes object contains an object of type image.

Convert the HDR image to a dynamic range that can be viewed on a computer, using the tonemap function. This function converts the HDR image into an RGB image of data type uint8.

rgb = tonemap(hdr_image);
whos
  Name             Size                  Bytes  Class     Attributes

  hdr_image      665x1000x3            7980000  single              
  rgb            665x1000x3            1995000  uint8               

Display the RGB image.

imshow(rgb)

Figure contains an axes object. The hidden axes object contains an object of type image.

See Also

| |

Related Topics