Skip to main content

Description

Bifrost is a temporal derainbowing filter created by Fredrik Mellbin.

The original Avisynth plugin (version 1.1) worked on the whole frame or not at all. This version works on blocks, meaning that static parts of the image can be processed even if something moves on screen.

The VapourSynth plugin will accept any 8 to 16 bit integer YUV format. The Avisynth plugin is still limited to YV12.

Usage

bifrost.Bifrost(clip clip[, clip altclip=clip, float luma_thresh=10.0, int variation=5, bint conservative_mask=False, bint interlaced=True, int blockx=4, int blocky=4])
  • altclip

    Bifrost will copy from this clip the chroma of the blocks it can’t process. This allows moving blocks to be processed with some other filter. altclip must have the same format, dimensions and length as clip.

  • luma_thresh

    Blocks where the luma changes less than this are considered static and may be processed.

  • variation

    Controls how big a chroma change must be in order to be considered a rainbow. Increasing this can reduce false positives.

Note: luma_thresh and variation are given in 8 bit sample units and are scaled to the clip’s bit depth internally, so the same values behave the same way at any depth.

  • conservative_mask

    If true, only pixels detected as rainbows will be processed. Otherwise, pixels that have rainbows above and below them will also be processed.

  • interlaced

    If true, SeparateFields, DoubleWeave and SelectEvery will be invoked in order to process the top and bottom fields separatedly.

  • blockx

  • blocky

    The dimensions of the blocks. Smaller is probably better. The default 4×4 should be good enough. They must be a multiple of the clip’s subsampling, at least two chroma samples wide and tall, and no larger than the frame.

Note: If the dimensions of the image aren’t divisible by blockx and blocky, the right and/or bottom edges won’t be processed. The chroma of those edges is copied from altclip, same as for any other block Bifrost can’t process.

Types of rainbows

When dealing with telecined material you must determine if the rainbows were added before or after the telecine process. Find a scene with clearly visible rainbows and use the following:

src = your.Source()
separated = std.SeparateFields(src)
even = std.SelectEvery(separated, 2, 0)

If the rainbows change every frame, they were added after telecine. If there is a duplicate every five frames, they were added before.

Rainbows added before telecine

First you must fix the telecine, then use Bifrost in progressive mode:

ret = d2v.Source("rainbows1.d2v")
ret = vivtc.VFM(ret, order=1, chroma=False, mchroma=False)
ret = vivtc.VDecimate(ret, chroma=False)
ret = bifrost.Bifrost(ret, interlaced=False)

Rainbows added after telecine

In this case, Bifrost should be used in interlaced mode, right after the source filter:

ret = d2v.Source("rainbows2.d2v")
ret = bifrost.Bifrost(ret, interlaced=True)
# ivtc here

Installation

pip install vapoursynth-bifrost

Compilation

Requires Meson >= 1.2.3 and a C++17 compiler. VapourSynth must be installed and importable by the Python that Meson finds, because the include path is queried with vapoursynth.get_include(). That same interpreter also decides where the plugin installs (<site-packages>/vapoursynth/plugins).

meson setup build
ninja -C build

If you have several Python installations, point Meson at the right one with a native file containing:

[binaries]
python = '/path/to/python'

and passing --native-file to meson setup.

To build a wheel instead:

python -m build

DLLs for Avisynth 2.5.8+ can be found in the “releases” section.

License

The license is WTFPL; see the LICENSE file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vapoursynth_bifrost-4.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vapoursynth_bifrost-4.0-py3-none-win_amd64.whl (210.2 kB view details)

Uploaded Python 3Windows x86-64

vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_aarch64.whl (999.3 kB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (182.2 kB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (168.9 kB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

vapoursynth_bifrost-4.0-py3-none-macosx_11_0_arm64.whl (18.3 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

vapoursynth_bifrost-4.0-py3-none-macosx_10_15_x86_64.whl (18.5 kB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file vapoursynth_bifrost-4.0.tar.gz.

File metadata

  • Download URL: vapoursynth_bifrost-4.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vapoursynth_bifrost-4.0.tar.gz
Algorithm Hash digest
SHA256 f90612df4aa3a111a1fd6607efe1951afba4867ac6623281054702cded426c0b
MD5 a757fffc4fe03ecc75ac774a0b2b9154
BLAKE2b-256 2c1b6820b3f14fb53332b3a38553820fc54d08b5891b814d094a422b1e0d87e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0.tar.gz:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8d30dd3c99b09b71c470486440a2143d02a01f05eb5d9760126289692b9dc7fa
MD5 14a668bf8b096397a39d0b731ce80724
BLAKE2b-256 d501863a55724fd35b175e571b20946736717852e7c8ed6ed7a10462c9f76a5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-win_amd64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 12b3f8342b2ebc10eb2951f517d250881d43f334dd675f2ef9204b811c26a410
MD5 54e1756768a1b8218271c26abcdad874
BLAKE2b-256 17356d6c3179ae22a6e8c4d2b357b80cf02eb6e2aecc29d27b9b16f04911166f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_x86_64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 57aecf36d3df0aad4d0ab8172d665372423cabd7170078ac65f2ae12a5bf20ae
MD5 ce8aed1ee10091cd6771a1ba2993625f
BLAKE2b-256 2f5f8a05429e0c037c952da7b77120a8c47a8303b4694aabb8cce8cfa1be1980

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-musllinux_1_2_aarch64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0144ea7596aa0bfcd9780da0a8979a3a150b4552bd8364d93111be090ba52b9
MD5 14fbe4ea98d3761676e3141e1aecfd76
BLAKE2b-256 8ce1a40673957ecfb50254a34ce4f172d3f3e602785bdc5a461a683479279f00

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9a33bc0f47b68a2d39595c4232976051aabe386908d3b3d46661a254e00d7ca7
MD5 bda4ebf0ae6cd3321d67b264f0691db2
BLAKE2b-256 2d3a93a170fd2ac83726952af4e1405582134ef08ac8daa0831096d3508312be

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d535817d9902f5b8caa7114d8d8238eb7b702e5e56972f4b88ea2b9e7efdcb8
MD5 31ad42079ae524482163b70a9e2b2926
BLAKE2b-256 9f161261814ab0d021ea442cf60fb6a4a258e048a024d896991dd448c0f98ea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-macosx_11_0_arm64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vapoursynth_bifrost-4.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_bifrost-4.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1add287386313c9a984f161e8976e28db3f0d0365f82d4ca965f4c4fa327464e
MD5 4c218c05df0e17a88121c14c97a0fc03
BLAKE2b-256 3b3469433b62177d410a58f48cc9d20d4c421430f88c5084747fa40f0b0a2494

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_bifrost-4.0-py3-none-macosx_10_15_x86_64.whl:

Publisher: build.yml on dubhatervapoursynth/vapoursynth-bifrost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

4.0 This release

8 files

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