Skip to content

how to limit atadenoise to a srgb threshold 0-25(smoothstep)35 #14519

Answered by geextahslex
geextahslex asked this question in Q&A
Discussion options

You must be logged in to vote

solved by @Ashyni
Thank you :)

local label_prefix = mp.get_script_name()
local toggle = true

local function on_toggle()
    if toggle then
        mp.commandv("vf", "pre", string.format(
            "@%s:lavfi=[split=3[original][denoise][mask];[mask]lutyuv=y=between(val\\,0\\,150)*1023+between(val\\,151\\,170)*(170-val)*10.23[masked];[denoise]atadenoise=s=5[denoised];[denoised][masked]mergeplanes=0x00010210:yuva420p10le[merged];[original][merged]overlay]",
            label_prefix))
    else
        mp.commandv("vf", "remove", string.format("@%s", label_prefix))
    end
    toggle = not toggle
end

mp.add_key_binding("F2", "toggle_filter", on_toggle)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by geextahslex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant