Skip to main content

vsflip

vsflip is a high-performance native VapourSynth plugin and Python wrapper for NVIDIA's FLIP perceptual metric. It computes frame-by-frame perceptual error maps and scores between a reference and a test video.

Features

  • CUDA & CPU Backends: Accelerated evaluation on NVIDIA GPUs (RTX 2000+) with multi-threaded CPU fallback.
  • Grayscale & Magma Maps: Output error maps as float grayscale (GRAYS) or 3-channel heatmap (RGBS).
  • Frame Properties: Every frame stores its perceptual score in props.meanFLIPError (lower is closer; 0.0 is identical).
  • Physical Presets: Built-in viewing condition presets for monitors, phones, and TVs (FlipParams).
  • LDR & HDR: Supports both standard sRGB and high dynamic range content.

Requirements

  • Python: ≥ 3.12
  • VapourSynth: ≥ R74
  • (Optional for CUDA): NVIDIA GPU (RTX 2000 or newer) with display driver installed

Installation

1. Python Package

pip install vsflip

(Pre-compiled wheels bundle the native binary out of the box).

2. Manual Compilation (Optional)

If building from source:

cmake -B build -A x64 -DCMAKE_CUDA_ARCHITECTURES="75;80;86;89;90;89-virtual"
cmake --build build --config Release

Place vsflip.dll (Windows) or libvsflip.so (Linux) in your VapourSynth plugins/ directory or inside the vsflip/ folder.

Usage

import vapoursynth as vs
core = vs.core
from vsflip import vsflip_video, vsflip_frame, FlipParams

ref = core.ffms2.Source("reference.mkv")
test = core.ffms2.Source("encoded.mkv")

# Convert clips to vs.RGBS with the appropriate matrix/transfer for your source
ref_rgbs = core.resize.Bicubic(ref, format=vs.RGBS, matrix_in=1)
test_rgbs = core.resize.Bicubic(test, format=vs.RGBS, matrix_in=1)

# Compare entire videos (returns GRAYS clip)
result = vsflip_video(ref_rgbs, test_rgbs, params=FlipParams.Monitor.reference, device="cuda")

# Output as Magma color heatmap (returns RGBS clip)
heat_map = vsflip_video(ref_rgbs, test_rgbs, magma=True, device="cuda")

# Compare a single frame
single = vsflip_frame(ref_rgbs, test_rgbs, ref_frame=100, test_frame=100)

# For HDR videos (e.g. BT.2020 PQ), convert to Linear RGBS (transfer='linear'):
# ref_hdr = core.resize.Bicubic(ref, format=vs.RGBS, matrix_in=9, transfer_in=16, transfer="linear")
# test_hdr = core.resize.Bicubic(test, format=vs.RGBS, matrix_in=9, transfer_in=16, transfer="linear")
# result = vsflip_video(ref_hdr, test_hdr, dynamic_range="HDR")

result.set_output()

Parameter Presets (FlipParams)

FlipParams provides presets modeling human contrast sensitivity for different viewing environments:

Category Presets
Monitor (50 cm distance) FlipParams.Monitor.fhd (27" 1080p), mainstream (27" 1440p), reference (31" 4K), retina (27" 5K)
Mobile (17 cm distance) FlipParams.Mobile.budget (6.67" 1080p), reference (6.9" 1440p), retina (6.9" Retina)
TV (living room distance) FlipParams.TV.reference (65" 4K at 2.5 m), retina (65" 4K at 1.31 m)

You can also pass a custom dict: params={"ppd": 67.0}.

License

This project is licensed under the MIT License. See LICENSE for details.

Third-Party

  • NVIDIA FLIP (src/include/FLIP.h): Copyright © 2020-2026 NVIDIA Corporation & Affiliates (BSD 3-Clause).

    Note: src/include/FLIP.h contains minor adjustments (thread-safe lazy initialization of color maps) to prevent Windows dynamic library loader-lock deadlocks, ensuring seamless compatibility within the VapourSynth plugin environment while preserving all perceptual algorithms and formulas intact.

Metadata

Release files for vsflip 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vsflip 2.0.1
File Size Uploaded Provenance Actions
vsflip-2.0.1.tar.gz 6.9 kB With provenance Details for vsflip-2.0.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for vsflip 2.0.1
File Interpreter ABI Platform Actions
vsflip-2.0.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for vsflip-2.0.1-py3-none-win_amd64.whl
vsflip-2.0.1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for vsflip-2.0.1-py3-none-manylinux_2_35_x86_64.whl

Total release size: 932.6 kB

Release files / vsflip-2.0.1.tar.gz

Download URL vsflip-2.0.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a26664b4896088886817f988663b156bf06e633face6b6b9012153e46bad7a54
BLAKE2b-256 checksum
How to use checksums
a2d3eaa091699877c3bbf99de5e20774a271c134c62f0a16def461acf03e375e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / vsflip-2.0.1-py3-none-win_amd64.whl

Download URL vsflip-2.0.1-py3-none-win_amd64.whl
Size 333.1 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b98f4ea349b9b6af62b3633b2f847476b8655adce895da26ea792d061adec3f0
BLAKE2b-256 checksum
How to use checksums
d22ceb22982666d15d751ab0707c7b0c03a43d170b7a5fef5059be1820f06b61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / vsflip-2.0.1-py3-none-manylinux_2_35_x86_64.whl

Download URL vsflip-2.0.1-py3-none-manylinux_2_35_x86_64.whl
Size 592.6 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
8e6ad9f367b0d5b0db1dcd7f3cb7e574d9b28c35fb848ce089447c8e87946b10
BLAKE2b-256 checksum
How to use checksums
d9daa4fa6b28e2b784adb9830b3351842c7630cb937f557637a82cbad16460d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for vsflip 2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for vsflip-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page