This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Read high dynamic range (HDR) image


hdr = hdrread(filename)



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.


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".

Introduced in R2007b