This project aims at exploring and providing high-quality, perceptually plausible HDR tone mapping.
Provided are a C API for tone mapping Rec. 2020 + PQ to sRGB, as well as a command-line tool that can be run on image files.
In a nutshell:
FoteliParams* params = FoteliCreateParams();
FoteliSetFloatBuffers(params, &red, &green, &blue);
FoteliSetImageSize(params, width, height);
/* Optional, defaults to width: */
FoteliSetRowStride(params, row_stride);
if (const char* error_message = FoteliValidateParams(params)) {
fprintf(stderr, "Foteli error: %s\n", error_message);
exit(EXIT_FAILURE);
}
FoteliToneMap(params);
FoteliDestroyParams(params);
$ foteli pq_input.png srgb_output.png
In the future, we hope to improve this codebase in the following ways:
-
better performance (the current version is written in naïve C++ with few optimizations);
-
support for other input and output colorspaces (at the very least, linear input, and wider output gamuts);
-
exploring other tone mapping approaches.
We plan to maintain API and ABI stability while doing so.
See CONTRIBUTING.md
for details.
Apache 2.0; see LICENSE
for details.
This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.