simple curve added.
tonemap: better algo + nan fixes