Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import vapoursynth as vs
- core = vs.get_core()
- def make_gray_lines(width, height):
- white_clip = core.std.BlankClip(width=width, height=1, format=vs.GRAY8, color=255)
- black_clip = core.std.BlankClip(width=width, height=1, format=vs.GRAY8, color=0)
- line_source = []
- for line in range(height):
- if (line % 8 == 0) or (line % 8 == 7):
- line_source.append(white_clip)
- else:
- line_source.append(black_clip)
- return core.std.StackVertical(line_source)
- def make_gray_grid(width, height):
- h_lines = make_gray_lines(width, height)
- v_lines = core.std.Transpose(make_gray_lines(height, width))
- return core.std.Expr([h_lines, v_lines], expr='x y max')
- def make_grid(width, height):
- return core.std.ShufflePlanes([make_gray_grid(width, height), make_gray_grid(width // 2, height // 2)], planes=[0, 0, 0], colorfamily=vs.YUV)
- make_grid(640, 480).set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement