Made hdr more extensible for use as the basis of the hdr-to-png module
Always outputs XYZ format, doing the conversion from RGB internally if necessary