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.0.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.0-py3-none-win_amd64.whl (88.1 kB view details)

Uploaded Python 3Windows x86-64

vapoursynth_adaptivegrain-0.4.0-py3-none-win32.whl (88.1 kB view details)

Uploaded Python 3Windows x86

vapoursynth_adaptivegrain-0.4.0-py3-none-manylinux_2_28_x86_64.whl (210.8 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

vapoursynth_adaptivegrain-0.4.0-py3-none-macosx_11_0_arm64.whl (184.2 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e98be0c466cee08c9e37619fb4d58d953319e78ddd1a1d5b754b462dc8c96c6f
MD5 088a9927af0d443d37ca66db5c754304
BLAKE2b-256 5990775dedfb2ea7b32235bb762a382a57845c3f6b95a3c2575b2f0cb32de71c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.0.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.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e8416c13b273ec565a5f3f42a10497610bbbe6d53afe7524ce520e68aa1c74d5
MD5 771fa6b93bf840a6476bf23c26985db2
BLAKE2b-256 d593a46e6b0cd1319412bfc07e4369edb88a21324fc53da41189a9ef10b69d36

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.0-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.0-py3-none-win32.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 9cc48d39b702d515a20521e8b0e113146ba176c0173880193fcd7b20ba6dccd0
MD5 ca925dcc982d21c9ffde3e8da1d6139e
BLAKE2b-256 1c64277a21acbe7bb4f0b0c6ce95e9a95b42d89952dfb77eb5c266eb95881989

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.0-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.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7fe38e22861d0eadbeeaf4d585137db3d6ce6f0cc620c6cba41bc31efd5665ae
MD5 623c3b1cee128964fdcb4737ff24db6b
BLAKE2b-256 ae21f9f448bcd00d76436a60fb4cc1bed20b6f2b9e23ef1fc51be172d87135fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.0-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.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fde70a3f384349b70d608bd3f35d89a4dae09ba048035d6092f69610260a515
MD5 5b397dc31e65ec5e2bf5cbe66fa6d0d9
BLAKE2b-256 31104329c5b830a61b560dcc6319ce231eefcfe7894a9b73d373dd832c04d3b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.4.0-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