Skip to main content

Hysteresis filter as a VapourSynth plugin.

Project description

vapoursynth-hysteresis

Hysteresis filter as a VapourSynth plugin, with the same API as misc.Hysteresis() from vs-miscfilters-obsolete.

Description from vs-miscfilters-obsolete:

Grows the mask in clipa into the mask in clipb. This is an equivalent of the Avisynth function mt_hysteresis. Note that both clips are are expected to be in the typical mask range which means that all planes have to be in the 0-1 range for floating point formats.

Specifically, Hysteresis takes two bi-level masks clipa and clipb and generates another bi-level mask clip. Both clipa and clipb must have the same dimensions and format, and the output clip will also have that format.

If we treat the planes of the clips as representing 8-neighbourhood undirected 2D grid graphs, for each of the connected components in clipb, the whole component is copied to the output plane if and only if one of its pixels is also marked in the corresponding plane from clipa. The argument planes controls which planes to process, with the default being all. Any unprocessed planes will be copied from the corresponding plane in clipa.

Install

Via vsrepo:

vsrepo install hysteresis

Or manually on Windows: download a release from the Releases page and unzip hysteresis.dll into a plugins directory.

API

hysteresis.Hysteresis(
    clipa: vs.VideoNode,
    clipb: vs.VideoNode,
    planes: list[int] = [0, 1, 2]
)

Build

Rust v1.91.0-nightly and cargo may be used to build the project. Older versions will likely work fine but they aren't explicitly supported.

$ git clone https://github.com/sgt0/vapoursynth-hysteresis.git
$ cd vapoursynth-hysteresis

# Debug build.
$ cargo build

# Release (optimized) build.
$ cargo build --release

# Release build optimized for the host CPU.
$ RUSTFLAGS="-C target-cpu=native" cargo build --release

Project details


Download files

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

Source Distribution

vapoursynth_hysteresis-1.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

vapoursynth_hysteresis-1.1.0-py3-none-manylinux_2_39_x86_64.whl (679.2 kB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

File details

Details for the file vapoursynth_hysteresis-1.1.0.tar.gz.

File metadata

  • Download URL: vapoursynth_hysteresis-1.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vapoursynth_hysteresis-1.1.0.tar.gz
Algorithm Hash digest
SHA256 de6c8476f1bc59ac454b80c75e984332f5550c749640a88a158c674e194b25fe
MD5 4e5d5029af23f04d833bf398d2226686
BLAKE2b-256 94fb124348fc7783c695714225487d28b351fed63312e1108f74f219a906de79

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_hysteresis-1.1.0.tar.gz:

Publisher: publish.yml on sgt0/vapoursynth-hysteresis

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_hysteresis-1.1.0-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_hysteresis-1.1.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4d8843b84a46de47d402e0e3042f8891082df4f3033b715fda6d4afada477efd
MD5 db9ed81949dbb952b7c9d88d35e96218
BLAKE2b-256 2edc1619fc58b53e2141082815a4dd89847926c02853fad70e4658145b01477b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_hysteresis-1.1.0-py3-none-manylinux_2_39_x86_64.whl:

Publisher: publish.yml on sgt0/vapoursynth-hysteresis

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page