Log in

View Full Version : making a "temporal" Mrd_restoregrain


VideoMilk78
24th February 2025, 00:25
Being a grain enjoyer myself I've been using mrd_restoregrain:
Function mRD_RestoreGrain (clip rd, clip o, float "str1", float "str2") {
sisavs26 = !(VersionNumber() < 2.60)

str1 = string(default(str1, 10.0))
str2 = string(default(str2, 20.0))

expr = sisavs26 ? " x range_half - abs "+str1+" scalef min "+str2+" scalef x range_half - abs - min 0 max x range_half - x range_half - abs 1 max / * range_half + " : " x 128 - abs "+str1+" min "+str2+" x 128 - abs - min 0 max x 128 - x 128 - abs 1 max / * 128 + "

Return sisavs26 ? mt_makediff(o, rd).mt_lut(expr, use_expr=2).mt_adddiff(rd, chroma="copy second") : mt_makediff(o, rd).mt_lut(expr).mt_adddiff(rd, chroma="copy second")
} To restore grain removed by removedirtMC or Spotless. The main issue is it also restores outlines of dirts and scratches, I was wondering if there would be a way to temporally fill in the scratch outlines with grain similar to what's around it?

joka
26th February 2025, 11:02
o is the grainy original clip.

Try

out = rd.mRD_RestoreGrain(o.SelectEvery(1,1)).mRD_RestoreGrain(o.SelectEvery(1,-1)).mRD_RestoreGrain(o)

VideoMilk78
26th February 2025, 22:41
out = rd.mRD_RestoreGrain(o.SelectEvery(1,1)).mRD_RestoreGrain(o.SelectEvery(1,-1)).mRD_RestoreGrain(o)

https://i.postimg.cc/MTv3ymLR/temp-Image-Xc-Qd-Cx.avif (https://postimg.cc/CBp40kSL)
Unfortunately I still got the same issue.