Butteraugli Documentation

repository·master·Indexed 24 days ago

https://github.com/google/butteraugli

A tool and C++ library for measuring perceived psychovisual differences between two images. It provides a scalar score and a spatial heatmap to estimate similarity in the domain of barely noticeable differences, supporting PNG and JPG formats.

Tokens
478
Snippets
3
Records
6
Agent score
34%

What's inside Butteraugli

  1. Understand butteraugli's output and scoring

    master

    Butteraugli provides two main outputs:

    1. A scalar value representing the difference.
    2. A spatial map (heatmap) showing the level of differences across the image.

    The scalar value can be compared against two reference values that categorize the difference into three experience classes:

    • 'great'
    • 'acceptable'
    • 'not acceptable'

    Note: The tool is primarily tuned for high-quality ranges (roughly equivalent to JPEG qualities 90 to 95) and may not be reliable for major image deformations.

  2. Build the butteraugli command-line utility

    master

    To build the command-line utility, use the Bazel build system. Ensure Bazel is installed on your system, then run the following command from the repository root:

    bazel build -c opt //:butteraugli
  3. Build butteraugli using Make

    master
    Alternatively, you can build the project using the provided Makefile located in the butteraugli directory. This method requires that libpng and libjpeg are installed on your system (including the corresponding -dev packages on some operating systems).
  4. Use butteraugli as a C++ library

    master
    Butteraugli provides a C++ interface for integrating psychovisual similarity estimation into your own projects. When using Bazel, you can depend on the //:butteraugli_lib target to include the library in your build.
  5. Compare two images using the command-line utility

    master

    The butteraugli command-line tool supports PNG and JPG images. To compare two images and receive a scalar difference score, run the tool with the two image paths as arguments:

    butteraugli image1.{png|jpg} image2.{png|jpg}
  6. Generate a difference heatmap with the command-line utility

    master

    To visualize the spatial distribution of differences between two images, you can instruct the tool to output a heatmap. The heatmap is produced as a PNM image. Provide the two input images followed by the desired output filename:

    butteraugli image1.{png|jpg} image2.{png|jpg} heatmap.pnm