Skip to content

Instantly share code, notes, and snippets.

@Gebbi
Gebbi / lineart_rpow2.py
Last active January 27, 2017 02:48
VapourSynth: lineart_rpow2
def lineart_rpow2 (src, w=1280, h=720, ow=1920, oh=1080, bicubic=False, b=1/3, c=1/3, cm_b=1/3, cm_c=1/3):
core = vs.get_core()
if src.format.bits_per_sample < 16:
src_16 = core.fmtc.bitdepth(src, bits=16)
else:
src_16 = src
src_16_y = core.std.ShufflePlanes(src_16, planes=0, colorfamily=vs.GRAY)
if bicubic:
sharp = core.fmtc.resample(src_16_y, w, h, kernel='bicubic', a1=b, a2=c, invks=True)
creditmask = core.fmtc.resample(DebicubicM(src_16, w, h, b=cm_b, c=cm_c, showmask=1), ow, oh, kernel='bicubic')