Re-format, added support for color data.
Reformat of comments, added support for empty inverse response function (linear).
Optimizing on the camera zenith angle instead of the horizon line.

Much more intuitive this way! Results are close enough.