Last active
November 18, 2023 04:31
-
-
Save wiwaz/2e4c6b3cd2bf9143f21a0db4ae429465 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clippedmask(clip, vertical=False, threshold: list = None, columns: list = None, rows: list = None): | |
expr = f"x {threshold[0]} <= x {threshold[1]} >= or " | |
if vertical: | |
positions = rows | |
direction = "Y" | |
else: | |
positions = columns | |
direction = "X" | |
for i in range(len(positions)): | |
expr += f"{direction} {positions[i]} = " | |
if i > 0: | |
expr += "or " | |
expr += "and 255 0 ?" | |
return clip.akarin.Expr(expr, format=vs.GRAY8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment