NVlabs/flip

A tool for visualizing and communicating the errors in rendered images.

What it is

FLIP is an open‑source project that measures visually meaningful differences between two images – typically a test image (e.g., one produced by a renderer) and a reference image (the “ground truth”). It provides both a command‑line tool and programming APIs, and it comes in two variants:

  • LDR‑FLIP – for low dynamic range images (like typical 8‑bit PNGs)
  • HDR‑FLIP – for high dynamic range images (e.g., EXR files)

The project also includes a visualisation tool that shows where and how much the test image deviates from the reference, using error maps. The underlying ideas are described in two research papers (see the “Citation” section).

What it does

Given a reference image and a test image, FLIP computes a numerical error metric that reflects how a human viewer would perceive the differences. It then produces (optionally) an error map – an image that highlights regions of high perceptual error. This is useful for developers and researchers who want to compare the quality of different rendering algorithms or image processing methods.

How to get started (simplest way)

Install the Python package and run the tool from the command line:

pip install flip-evaluator
flip -r referenceImage.png -t testImage.png

The tool accepts PNG (for LDR) and EXR (for HDR) files. Run flip -h for all options.

More advanced usage

Python (API and tool)

  • Requires Python 3.10+.
  • Install: pip install flip-evaluator
  • Use the API by calling the functions shown in src/python/api_example.py.
  • Command line: flip --reference ref.{exr|png} --test test.{exr|png} [options]

C++ and CUDA

  • You can compile a native executable or library.
  • Windows: open src/cpp/FLIP.sln in Visual Studio, or build with CMake.
  • CMake: cmake .. inside a build directory, then cmake --build . (add --config Release on Windows).
  • CUDA acceleration is optional (enable with -DFLIP_ENABLE_CUDA=ON).
  • Tool usage: flip[-cuda].exe --reference ref --test test [options]

PyTorch (loss function)

  • LDR‑ and HDR‑FLIP are available as loss functions for neural networks.
  • Setup uses conda; see src/pytorch/flip_loss.py for the loss implementation.
  • Example training code is in src/pytorch/train.py.

Project structure and notes

  • Since v1.7, HDR‑FLIP’s automatic exposure can handle reference images with zero median luminance.
  • Since v1.6, the Python version is installable via pip install flip-evaluator.
  • In v1.3, the C++/CUDA implementation was consolidated into a single header file (FLIP.h).
  • The repository includes third‑party code (tinyexr and stb_image) with their respective licenses.
  • A list of papers that use/cite FLIP, a version history, and precision notes are available in the misc/ folder.

License

  • Copyright © 2020‑2025, NVIDIA Corporation & Affiliates.
  • Released under the BSD 3‑Clause License.
  • The distributed tinyexr code is BSD‑3‑Clause; stb_image is MIT.
  • Individual contributions are covered by an Individual Contributor License Agreement.

Citation

If you use FLIP, please cite the appropriate paper:

  • LDR‑FLIP paper for LDR image comparison.
  • HDR‑FLIP paper for HDR image comparison.
  • Ray Tracing Gems II chapter if you use the tool in a general way.

Links to papers and BibTeX are provided in the README.

Acknowledgements

The project credits a list of contributors (see the README).


All details above are taken directly from the project’s README (version v1.7). For the most up‑to‑date information, refer to the original repository.

Related

  • Project
  • Project
  • Project
  • Project