How to load *.hdr files using python

Dawei Yang picture Dawei Yang · Sep 25, 2015 · Viewed 11.4k times · Source

I would like to read an environment map in *.hdr file format. It seems that very popular libraries doesn't support .hdr file reading, for example, OpenCV, PIL etc.. So how to read a .hdr file into a numpy array?

Answer

Dawei Yang picture Dawei Yang · Sep 25, 2015

I found ImageIO very useful. It can handle many image file formats including .hdr images. Here is the list: ImageIO Formats

It can be easily installed using easy_install or pip.