Skip to main content

adaptivegrain filter as a VapourSynth plugin.

Project description

Adaptivegrain-rs

Reimplementation of the adaptive_grain mask as a Vapoursynth plugin. For a description of the math and the general idea, see the article.

Usage

core.adg.Mask(clip, luma_scaling: float)

You must call std.PlaneStats() before this plugin (or fill the PlaneStatsAverage frame property using some other method). Supported formats are YUV with 8-32 bit precision integer or single precision float. Half precision float input is not supported since no one seems to be using that anyway. Since the output is grey and only luma is processed, the subsampling of the input does not matter.

To replicate the original behaviour of adaptivegrain, a wrapper is provided in kagefunc. It behaves exactly like the original implementation (except for the performance, which is about 3x faster on my machine).

Parameters

clip: vapoursynth.VideoNode

the input clip to generate a mask for.

luma_scaling: float = 10.0

the luma_scaling factor as described in the blog post. Lower values will make the mask brighter overall.

Build instructions

If you’re on Arch Linux, there’s an AUR package for this plugin. Otherwise you’ll have to build and install the package manually.

cargo build --release

That’s it. This is Rust, after all. No idea what the minimum version is, but it works with stable rust 1.83. That’s all I know. Binaries for Windows and Linux are in the release tab.

FAQ

Why do I have to call std.PlaneStats() manually?

Because I didn’t want to reimplement it. kagefunc.adaptive_grain(clip, show_mask=True) does that for you and then just returns the mask. Because I was too dumb to realize this exists. I’ll fix that at some point.™

Why doesn’t this also add grain?

I was going to do that originally, but I didn’t want to reimplement grain when we already have a working grain filter (multiple even, which gives you the option to choose whichever you want).

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_adaptivegrain-0.4.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distributions

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

vapoursynth_adaptivegrain-0.4.1-py3-none-win_amd64.whl (87.9 kB view details)

Uploaded Python 3Windows x86-64

vapoursynth_adaptivegrain-0.4.1-py3-none-win32.whl (87.8 kB view details)

Uploaded Python 3Windows x86

vapoursynth_adaptivegrain-0.4.1-py3-none-manylinux_2_28_x86_64.whl (210.4 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

vapoursynth_adaptivegrain-0.4.1-py3-none-macosx_11_0_arm64.whl (184.0 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file vapoursynth_adaptivegrain-0.4.1.tar.gz.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.1.tar.gz
Algorithm Hash digest
SHA256 1c6e0b77326faa1f7045ff1d170361e6fbcdfc0720b9c4733909603b60c2282e
MD5 b400dd0ad1541ef5dbd537244591e14e
BLAKE2b-256 3bb5eb4fc6f4061719e770b5de58c34bd42e846940c4c4518173360dd0ff59f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.1.tar.gz:

Publisher: publish.yml on kageru/adaptivegrain

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_adaptivegrain-0.4.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c5b7806247f61d17c51061db904f25f8ef4be9b6daba1bf420c22610e6fac968
MD5 b437c6b0279117a7bd68ef3584f9923e
BLAKE2b-256 f854c576889047a02131f702e02bee78faca559eb94782fcb045f6f759edc97a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.1-py3-none-win_amd64.whl:

Publisher: publish.yml on kageru/adaptivegrain

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_adaptivegrain-0.4.1-py3-none-win32.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.1-py3-none-win32.whl
Algorithm Hash digest
SHA256 b02d37f86e93d75247dd9eba1d957e2d0956a3c2b3edd9380dbcb078259a152b
MD5 203cd32dddb3a1b0ed28a527d06563c5
BLAKE2b-256 d3b9af664780071aad9de2c60297e069e57641a8960a9e2c0552012a8ecf7faa

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.1-py3-none-win32.whl:

Publisher: publish.yml on kageru/adaptivegrain

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_adaptivegrain-0.4.1-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c7b5d6c85f5400a369718410bd4f49fc73f186b3df00f739edf155833294437
MD5 bb1cf18fcc653b474fc59b5e08fa7898
BLAKE2b-256 1766c84b1954463eb0c37b2207143d4e30d1226ce1635b9bf8dc184c8cd17f72

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.1-py3-none-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on kageru/adaptivegrain

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_adaptivegrain-0.4.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0f88a25e1bc692261a398ce4add47217aa9c215fa79506d424979575e2ca08d
MD5 cb987e7b4e1353b0710d495023cba55f
BLAKE2b-256 c718dc95314e1e22a8395eea421ecdadaaac0dc78ffa6ce8db1b3069e13b37cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.1-py3-none-macosx_11_0_arm64.whl:

Publisher: publish.yml on kageru/adaptivegrain

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