Skip to content

Butteraugli

dnjulek edited this page Oct 30, 2026 · 1 revision

Image metric Butteraugli, ported from libjxl. It gives the same scores as libjxl's butteraugli_main tool (within float rounding). Lower is better: about 1.0 or less means the difference is hard to see, 2.0 and above means it is clearly visible.

Usage

vszip.Butteraugli(vnode reference, vnode distorted[, float intensity_target=80.0, float hf_asymmetry=1.0, float xmul=1.0, int distmap=0])
ref = core.bs.VideoSource("ref.mkv").resize.Bicubic(format=vs.RGB24, matrix_in_s="709")
dist = core.bs.VideoSource("dist.mkv").resize.Bicubic(format=vs.RGB24, matrix_in_s="709")
res = core.vszip.Butteraugli(ref, dist)

Each frame gets two properties: Butteraugli (the distance, the largest value of the difference map, what butteraugli_main prints first) and Butteraugli3Norm (its 3-norm, an average that is less sensitive to a single bad spot).

Parameters

  • reference, distorted:
    RGB clips of the same format, size and length: 8–16-bit integer or 32-bit float. Samples are read as sRGB; frames tagged _Transfer=8 are read as linear light.

  • intensity_target (float, default: 80.0, range: 0.001..10000):
    Display brightness in nits that a value of 1.0 maps to. 80 is libjxl's default for SDR.

  • hf_asymmetry (float, default: 1.0, range: 0.001..1000):
    Weighs new high-frequency artifacts against lost detail. Above 1 penalizes added artifacts more. butteraugli_main uses 1.0; the old core.julek plugin used 0.8.

  • xmul (float, default: 1.0, range: 0..1000):
    Multiplier for the red-green (X) channel's difference.

  • distmap (int, default: 0, range: 0..2):
    0: return the reference clip with the properties.
    1: return libjxl's heatmap of the difference map (butteraugli_main --distmap colors), in the input format and tagged as sRGB.
    2: return the raw difference map as GRAYS (without color tags).

Clone this wiki locally