Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions kagefunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
kageru’s collection of vapoursynth functions.
"""
from functools import partial
from vsutil import *
import vapoursynth as vs

import mvsfunc as mvf
import fvsfunc as fvf
import vapoursynth as vs
from vsutil import *

core = vs.core

Expand Down Expand Up @@ -67,6 +67,11 @@ def inverse_scale(
planes = _descale_chroma(planes, width, height)

if mask_detail:
try:
import fvsfunc as fvf
except ImportError as e:
raise ImportError("Missing required dependency: `fvsfunc`") from e

upscaled = fvf.Resize(planes[0], source.width, source.height, kernel=kernel, taps=taps, a1=b, a2=c)
planes[0] = mask_descale(get_y(source), planes[0], upscaled, zones=descale_mask_zones)
scaled = join(planes)
Expand All @@ -90,6 +95,11 @@ def mask_descale(
zones: str = '',
debug: bool = False,
):
try:
import fvsfunc as fvf
except ImportError as e:
raise ImportError("Missing required dependency: `fvsfunc`") from e

downscaled = core.resize.Spline36(original, descaled.width, descaled.height)
assert get_depth(original) == get_depth(descaled), "Source and descaled clip need to have the same bitdepth"
detail_mask = _generate_descale_mask(original, descaled, upscaled, threshold)
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ version = "1.0.1"
description = "kageru's collection of VapourSynth functions"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.12"
dependencies = [
"vapoursynth",
"vsutil",
"vapoursynth-adaptivegrain",
"mvsfunc",
]

[tool.uv.sources]
mvsfunc = { git = "https://github.com/HomeOfVapourSynthEvolution/mvsfunc.git" }


[project.urls]
Homepage = "https://github.com/Irrational-Encoding-Wizardry/kagefunc"

Expand Down
73 changes: 73 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.