Roemer
6th February 2021, 01:18
Hello all
i am working on some video which has a few pixels black borders (it's a cartoon). The borders are between 2 and 10 pixels on the sides.
Now I thought about just inpainting the borders instead of cropping them.
I actually wrote a small function that uses exinpaint to do this:
function InPaintBorder(clip v, int left, int top, int right, int bottom) {
correctedClip = v.Crop(left, top, -right, -bottom).AddBorders(left,top,right,bottom,color=$ffffff).ConvertToRGB(matrix="Rec709", interlaced=false)
mask = BlankClip(width=correctedClip.Width()-left-right, height=correctedClip.Height()-top-bottom).AddBorders(left,top,right,bottom,color=$ffffff).ConvertToRGB(matrix="Rec709", interlaced=false)
return exinpaint(correctedClip, mask, dilate=0, radius=64, color=$ffffff)
}
For single frames, it looks absolutely marvelous. But for animated stuff, as it only looks at the current frame, it shows some temporal instabilities.
Does anyone know of an alternative inpaint which does not have those instabilities?
Many thanks!
i am working on some video which has a few pixels black borders (it's a cartoon). The borders are between 2 and 10 pixels on the sides.
Now I thought about just inpainting the borders instead of cropping them.
I actually wrote a small function that uses exinpaint to do this:
function InPaintBorder(clip v, int left, int top, int right, int bottom) {
correctedClip = v.Crop(left, top, -right, -bottom).AddBorders(left,top,right,bottom,color=$ffffff).ConvertToRGB(matrix="Rec709", interlaced=false)
mask = BlankClip(width=correctedClip.Width()-left-right, height=correctedClip.Height()-top-bottom).AddBorders(left,top,right,bottom,color=$ffffff).ConvertToRGB(matrix="Rec709", interlaced=false)
return exinpaint(correctedClip, mask, dilate=0, radius=64, color=$ffffff)
}
For single frames, it looks absolutely marvelous. But for animated stuff, as it only looks at the current frame, it shows some temporal instabilities.
Does anyone know of an alternative inpaint which does not have those instabilities?
Many thanks!