Video/Image filter to undo upscaling.
Project description
Descale
Video/Image filter to undo upscaling.
This fork only supports VapourSynth, none of the new options are mapped in AviSynth. PRs to add AviSynth support are welcome, but apart from that the AviSynth plugin can be considered frozen.
Usage
The VapourSynth plugin itself supports every constant input format. If the format is subsampled, left-aligned chroma planes are always assumed.
descale.Debilinear(clip src, int width, int height, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Debicubic(clip src, int width, int height, float b=0.0, float c=0.5, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Delanczos(clip src, int width, int height, int taps=3, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Despline16(clip src, int width, int height, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Despline36(clip src, int width, int height, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Despline64(clip src, int width, int height, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Depoint(clip src, int width, int height, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
descale.Decustom(clip src, int width, int height, func custom_kernel, int taps=3, float blur=1.0, float[] post_conv=[], float src_left=0.0, float src_top=0.0, float src_width=width, float src_height=height, int border_handling=0, clip ignore_mask=None, bool force=false, bool force_h=false, bool force_v=false, int opt=0)
The border_handling argument can take the following values:
- 0: Assume the image was resized with mirror padding
- 1: Assume the image was resized with zero padding
- 2: Assume the image was resized with extend padding, where the outermost row was extended infinitely far
The opt argument can take the following values:
- 0: Automatically decide based on CPU capabilities
- 1: No SIMD instructions
- 2: Use AVX2
The AviSynth+ plugin is used similarly, but without the descale namespace.
Custom kernels and ignore masks are only supported in the VapourSynth plugin.
Custom kernels
# Debilinear
core.descale.Decustom(src, w, h, custom_kernel=lambda x: 1.0 - x, taps=1)
# Delanczos
import math
def sinc(x):
return 1.0 if x == 0 else math.sin(x * math.pi) / (x * math.pi)
taps = 3
core.descale.Decustom(src, w, h, custom_kernel=lambda x: sinc(x) * sinc(x / taps), taps=taps)
How does this work?
Resampling can be described as A x = b.
A is an n x m matrix with m being the input dimension and n the output dimension. x is the original vector with m elements, b is the vector after resampling with n elements. We want to solve this equation for x.
To do this, we extend the equation with the transpose of A: A' A x = A' b.
A' A is now a banded symmetrical m x m matrix and A' b is a vector with m elements.
This enables us to use LDLT decomposition on A' A to get LD L' = A' A. LD and L are both triangular matrices.
Then we solve LD y = A' b with forward substitution, and finally L' x = y with back substitution.
We now have the original vector x.
Installation
Pre-compiled wheels are available on PyPI for:
- Windows: x86_64
- Linux: x86_64 and aarch64 (glibc & musl)
- macOS: x86_64 (10.13+) and arm64 (11.0+)
pip install vapoursynth-descale
Compilation
Building the VapourSynth plugin:
uv build --wheel
For the AviSynth+ plugin:
meson setup build -Dlibtype=avisynth && meson compile -C build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vapoursynth_descale-12.tar.gz.
File metadata
- Download URL: vapoursynth_descale-12.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c64d8bd37cad9d455cbe8e3f3139a61c8b97af4425aba48d48ff31989a1f5a89
|
|
| MD5 |
403b2eab313f3e7be6912ef5d9b615ff
|
|
| BLAKE2b-256 |
0e67b9336f58a1f8b45d9e811715db936e2a36fafba3b33dfaa1865a41b37aa7
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12.tar.gz:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12.tar.gz -
Subject digest:
c64d8bd37cad9d455cbe8e3f3139a61c8b97af4425aba48d48ff31989a1f5a89 - Sigstore transparency entry: 1280864196
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-win_amd64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-win_amd64.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b258a281f6f110a450396194d44bc00b77d2395392f9d1fbee832dfdb5c0de
|
|
| MD5 |
93497be1f19f3f2a6f8242a09a271efe
|
|
| BLAKE2b-256 |
f83bf4490aed9b49376894e84509b408a35dffeae047d326d8dca3ddae32d6e5
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-win_amd64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-win_amd64.whl -
Subject digest:
a0b258a281f6f110a450396194d44bc00b77d2395392f9d1fbee832dfdb5c0de - Sigstore transparency entry: 1280864341
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9730cbd412d836da4cbc98ac03488b2776a9ebe2b15d0436441dd79e6a008b02
|
|
| MD5 |
87043f0bc0508cb58d616ce104670e77
|
|
| BLAKE2b-256 |
c7e0719b80d3d358d156177186422f479003ab53d29df658d1ea4a847991abb9
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-musllinux_1_2_x86_64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-musllinux_1_2_x86_64.whl -
Subject digest:
9730cbd412d836da4cbc98ac03488b2776a9ebe2b15d0436441dd79e6a008b02 - Sigstore transparency entry: 1280864227
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
038d1e6f9cff7a0c1bdb6fe7cd22d4e0a43cca7847b1516c9fe597c784445fc9
|
|
| MD5 |
bb422bd060808987830567d28b5c86a1
|
|
| BLAKE2b-256 |
4d6796847fae3818d0a5314f7e9b5f88fef314ff92e88bf221834d31251b93d7
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-musllinux_1_2_aarch64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-musllinux_1_2_aarch64.whl -
Subject digest:
038d1e6f9cff7a0c1bdb6fe7cd22d4e0a43cca7847b1516c9fe597c784445fc9 - Sigstore transparency entry: 1280864362
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 37.7 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9969dca2a6feb7cd5ff2b60e9198aa529f3db02f49d5c88556b3fbcaa822f05d
|
|
| MD5 |
e69e060f49829edcded3072fd573cd8f
|
|
| BLAKE2b-256 |
4bd1a819ce28422ab16ecce9c0bfbb9a9683f143fba6e3558a08f4c587fbd7e6
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
9969dca2a6feb7cd5ff2b60e9198aa529f3db02f49d5c88556b3fbcaa822f05d - Sigstore transparency entry: 1280864306
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a4b3494ac88b769333070ab279bb2d6590f37947f1669a6d628107007456793
|
|
| MD5 |
21aed50e272465ba01d792bf64aa7f41
|
|
| BLAKE2b-256 |
e7a999c648526f966cd00ca8decbb71194f51536e49e018738a87cd540404427
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
4a4b3494ac88b769333070ab279bb2d6590f37947f1669a6d628107007456793 - Sigstore transparency entry: 1280864210
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
101f146b32a3d5f7439f4aba663576fb74ab146b29cce520bb1d0b240bb1b2d2
|
|
| MD5 |
84283d2e6f4bd81b7051b2a0be5451f5
|
|
| BLAKE2b-256 |
ab565ebbaa1734f423df497a3fca46b9ce1d134b71ae724422e35b9e0437436f
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-macosx_11_0_arm64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-macosx_11_0_arm64.whl -
Subject digest:
101f146b32a3d5f7439f4aba663576fb74ab146b29cce520bb1d0b240bb1b2d2 - Sigstore transparency entry: 1280864266
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vapoursynth_descale-12-py3-none-macosx_10_13_x86_64.whl.
File metadata
- Download URL: vapoursynth_descale-12-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 35.7 kB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9206419849d74db3bac8fb5821f3feb5286450ad2df5f31776ba1e3ba6140347
|
|
| MD5 |
f7a81407a0f35bb3d9e4549f0a384d30
|
|
| BLAKE2b-256 |
1fc54951c7f7cb9c309c7b62e539d9cd126acaefe761568f0c02fabf81bb5fde
|
Provenance
The following attestation bundles were made for vapoursynth_descale-12-py3-none-macosx_10_13_x86_64.whl:
Publisher:
build.yml on Jaded-Encoding-Thaumaturgy/vapoursynth-descale
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_descale-12-py3-none-macosx_10_13_x86_64.whl -
Subject digest:
9206419849d74db3bac8fb5821f3feb5286450ad2df5f31776ba1e3ba6140347 - Sigstore transparency entry: 1280864241
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vapoursynth-descale@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Branch / Tag:
refs/tags/r12 - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@c720eac23860e952c58337ff02eb1d7ffb7b5f35 -
Trigger Event:
release
-
Statement type: