Skip to main content

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).

Metadata

Release files for vapoursynth-adaptivegrain 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vapoursynth-adaptivegrain 0.5.0
File Size Uploaded Provenance Actions
vapoursynth_adaptivegrain-0.5.0.tar.gz 17.4 kB With provenance Details for vapoursynth_adaptivegrain-0.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for vapoursynth-adaptivegrain 0.5.0
File Actions
vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl
vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl
vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl
vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl
vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details for vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl

Total release size: 1.6 MB

Release files / vapoursynth_adaptivegrain-0.5.0.tar.gz

Download URL vapoursynth_adaptivegrain-0.5.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f68b2953f459d74bd31b4af4b308811917f70623f8bd40b30ab4664bd6d699f
BLAKE2b-256 checksum
How to use checksums
6e8aaa50da0374b1339f5ce3c9a404c37b6e5f80fdf210d17b90bdf2d2550ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl

Download URL vapoursynth_adaptivegrain-0.5.0-py3-none-win_amd64.whl
Size 258.6 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ba68c65cf62a96bc2990d78ba80f593b63b2f9baf83f48f51c319f75d095cedb
BLAKE2b-256 checksum
How to use checksums
61dc1cf8ec79096ec83e2d6c223a44ece12ac2c5849f4c4b73f033ee2dea292d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl

Download URL vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_x86_64.whl
Size 553.6 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
f3df06e2f32239e20634c533145e977dc68a8fc62739ec4a7053e9e0d224f592
BLAKE2b-256 checksum
How to use checksums
a903588328b944be32e270b24d6a94b06a6c4da200f0e8e22aba273cf24f554f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl

Download URL vapoursynth_adaptivegrain-0.5.0-py3-none-manylinux_2_28_aarch64.whl
Size 177.3 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4a8b89a643b1710b6b6316bfec07fef9f1a4c727ddcae76bcbd7886fc2e43d78
BLAKE2b-256 checksum
How to use checksums
1706103226ffaaa3217c140de17eb2d00a7c515d173e65ca101925f998bae67b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl

Download URL vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_x86_64.whl
Size 370.9 kB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
974fe652716f6bcfdf6b03657cc905042bcaa6dec7aadb12acc45e6c7244a4f8
BLAKE2b-256 checksum
How to use checksums
5f858259a8572717fcb0ddd5361564246e0f7ea4f0ac83f5e5dceaeae7643a20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Release files / vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl

Download URL vapoursynth_adaptivegrain-0.5.0-py3-none-macosx_13_0_arm64.whl
Size 182.8 kB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
cf7c67edc1fac2a985ce3ba7436847a2ac375b6f1f96dd27e760dd6cab7535f0
BLAKE2b-256 checksum
How to use checksums
dbb955f5f08c46965448c3ab4bdc34d38e7ef5189f5120ba2398291c38c266a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

Security for vapoursynth-adaptivegrain 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for vapoursynth_adaptivegrain-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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