This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[HELP] seeking paid filter to remove purple fringing in old videos
#3
Here's a quick fix:
  • Start Hybrid
  • load source
  • enable "Filtering->Vapoursynth->Custom->Insert before DeCross" and enter:
    # create edgemask
    edges = core.std.Prewitt(clip.std.ShufflePlanes(0, vs.GRAY))

    bits = clip.format.bits_per_sample
    thr = 32 << (bits - 8)  # scale threshold to bitdepth

    mask = core.std.Binarize(edges, threshold=thr)

    # increase width of mask, by using higher integer values, depending on source and resolution
    increase = 0
    for _ in range(increase):
        mask = core.std.Maximum(mask)

    # optional: soften mask edges
    mask = core.std.BoxBlur(mask, hradius=1, vradius=1)

    # create desaturated version
    mid = 1 << (bits - 1)
    mult = 0.5  # 0.0 = grayscale chroma, 1.0 = unchanged

    desat = core.std.Expr(
        [clip],
        expr=[
            "",  # keep luma unchanged
            f"x {mid} - {mult} * {mid} +",
            f"x {mid} - {mult} * {mid} +"
        ]
    )

    # merge original with desaturated version around edges
    clip = core.std.MaskedMerge(clip, desat, mask)
To see what happens and tweaking the values depending on your source:
  • enable "Filtering->Vapoursynth->Misc->Preview->Split Compare View" and set "FilterView mode" to "orginal|filtered|diff"
  • enabled "Filtering->Compare view" (lower right corner)
  • enabled "Filtering->Synth auto refresh" (lower right corner)
  • open Vapoursynth Preview (lower right corner)
then adjust the parameters, i.e. thr, increase, mult, if your source differs from the sample.
[Image: grafik.png]
The filtering should be fast, on any machine.
No filters used that do no come with Vapoursynth itself, so any tool which allows you to add custom Vapoursynth code should work fine.
(+ works on Linux, Mac, Windows)
Side note: if processing speed is an issue, external filters can replace the used filters:
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
RE: seeking paid filter to remove purple fringing in old videos - by Selur - 1 hour ago

Forum Jump:


Users browsing this thread: 1 Guest(s)