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.5.0.tar.gz (17.4 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.5.0-py3-none-win_amd64.whl (258.6 kB view details)

Uploaded Python 3Windows x86-64

vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl (553.6 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl (177.3 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl (370.9 kB view details)

Uploaded Python 3macOS 13.0+ x86-64

vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl (182.8 kB view details)

Uploaded Python 3macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9f68b2953f459d74bd31b4af4b308811917f70623f8bd40b30ab4664bd6d699f
MD5 42aaa8d63d589c70cab1ddab90279ade
BLAKE2b-256 6e8aaa50da0374b1339f5ce3c9a404c37b6e5f80fdf210d17b90bdf2d2550ae6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ba68c65cf62a96bc2990d78ba80f593b63b2f9baf83f48f51c319f75d095cedb
MD5 deede3e903b83de3ea7b1d28e3622962
BLAKE2b-256 61dc1cf8ec79096ec83e2d6c223a44ece12ac2c5849f4c4b73f033ee2dea292d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3df06e2f32239e20634c533145e977dc68a8fc62739ec4a7053e9e0d224f592
MD5 eb19e7f4ba5668d81fdb120a165e7968
BLAKE2b-256 a903588328b944be32e270b24d6a94b06a6c4da200f0e8e22aba273cf24f554f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.5.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.5.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4a8b89a643b1710b6b6316bfec07fef9f1a4c727ddcae76bcbd7886fc2e43d78
MD5 94b26f0f2a8ad24cf5976b983a9bee53
BLAKE2b-256 1706103226ffaaa3217c140de17eb2d00a7c515d173e65ca101925f998bae67b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.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.5.0-py3-none-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 974fe652716f6bcfdf6b03657cc905042bcaa6dec7aadb12acc45e6c7244a4f8
MD5 2d7986ab043feae7c2966700fd11c8af
BLAKE2b-256 5f858259a8572717fcb0ddd5361564246e0f7ea4f0ac83f5e5dceaeae7643a20

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_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.5.0-py3-none-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 cf7c67edc1fac2a985ce3ba7436847a2ac375b6f1f96dd27e760dd6cab7535f0
MD5 75138122ee420f3d09984438f732d5b8
BLAKE2b-256 dbb955f5f08c46965448c3ab4bdc34d38e7ef5189f5120ba2398291c38c266a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_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