Main Content


Read high dynamic range (HDR) image



hdr = hdrread(filename) reads the high dynamic range (HDR) image, hdr, from the file specified by filename. For scene-referred data sets, pixel values usually are scene illumination in radiance units.


collapse all

Read high dynamic range image into the workspace.

hdr = hdrread('office.hdr');

Convert the HDR image to a lower dynamic range, suitable for display.

rgb = tonemap(hdr);

Display the image.


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

Input Arguments

collapse all

File name of HDR image, specified as a character vector or string scalar.

Example: 'office.hdr' or "office.hdr"

Data Types: char | string

Output Arguments

collapse all

HDR image, returned as an m-by-n-by-3 numeric array with values in the range [0,Inf).

Data Types: single


  • To display HDR images, use an appropriate tone-mapping function, such as tonemap.


[1] Larson, Greg W. "Radiance File Formats".

Version History

Introduced in R2007b