Skip to content

Instantly share code, notes, and snippets.

View Ichunjo's full-sized avatar
💻
Doing useless things

Vardë Ichunjo

💻
Doing useless things
View GitHub Profile
@Ichunjo
Ichunjo / hsv_red_catches_magick.py
Created January 23, 2022 02:31
RGB -> HSV VideoNode and catch red parts
import vapoursynth as vs
from vsmask.edge import FDOGTCanny
from vsmask.util import XxpandMode, expand, inpand, max_planes
from vsutil import join, split
core = vs.core
# clip = core.imwri.Read('unknown.png') * 10
@Ichunjo
Ichunjo / fine_dehalo.py
Last active April 24, 2024 23:48
fine_dehalo rewrite
from __future__ import annotations
from math import ceil, floor
from typing import Optional, Sequence
import vapoursynth as vs
from lvsfunc.kernels import BSpline, Lanczos, Mitchell
# https://github.com/Varde-s-Forks/RgToolsVS
from rgvs import minblur, repair
from vsmask.better_vsutil import join, split
@Ichunjo
Ichunjo / ssim_downsample.py
Created December 23, 2021 20:42
Vapoursynth SSIM Downsample
from __future__ import annotations
from functools import partial
from typing import Any, Literal, NamedTuple, Protocol
import vapoursynth as vs
from lvsfunc.kernels import Catrom, Kernel
from vsutil import depth, get_depth
core = vs.core
@Ichunjo
Ichunjo / interpolate_bezier_curve.py
Created December 15, 2021 22:38
interpolate_bezier_curve
from typing import List, NamedTuple
import math
class Point(NamedTuple):
x: float
y: float
def interpolate_bezier_curve(curv: List[Point], pct: float) -> Point:
@Ichunjo
Ichunjo / descreen.py
Last active November 13, 2022 05:58
descreen vapoursynth
from typing import Any
import cv2
import numpy as np
import vapoursynth as vs
from numpy.typing import NDArray
src = core.imwri.Read(r'Scans_assault_loli\02.png')
src.set_output(0)
@Ichunjo
Ichunjo / ass_wipe_mt.py
Last active January 1, 2022 20:39
AssWipeMT
import asyncio
import json
import os
import shutil
import subprocess
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Set
from pyonfx import Ass, Convert, Line
@Ichunjo
Ichunjo / ccd_new.py
Last active December 15, 2021 22:37
ccd_new
from typing import cast
import lvsfunc
import vapoursynth as vs
from vsutil import EXPR_VARS, join, split
core = vs.core
def add_expr(n: int) -> str:
@Ichunjo
Ichunjo / ExportText.lua
Created June 9, 2021 19:29
Export the selected lines without tags and line breaks, and display them in a new window
script_name = "Export Text"
script_description = "Export the selected lines without tags and line breaks, and display them in a new window"
script_version = "0.2"
script_author = "Vardë"
function export_text(subs, sel)
alltext = ''
for k, i in ipairs(sel) do
line = subs[i]
clean = line.text:gsub("{[^}]+}", "")
@Ichunjo
Ichunjo / nnedi3_rpow2CL.py
Created June 5, 2021 15:15
nnedi3_rpow2CL.py
import vapoursynth as vs
core = vs.core
def nnedi3_rpow2CL(clip, rfactor=2, width=None, height=None, correct_shift=True,
kernel="spline36", nsize=0, nns=3, qual=None, etype=None, pscrn=None,
device=-1):
"""nnedi3_rpow2 is for enlarging images by powers of 2.
Args:
@Ichunjo
Ichunjo / conv_webp_lossless.py
Last active August 22, 2020 12:20
Image conversion script anything -> webp using cwebp
"""Script conversion image"""
import os
import tkinter
import subprocess
import shlex
import multiprocessing
from multiprocessing.pool import ThreadPool as Pool
from tkinter.filedialog import askdirectory
from vsutil import is_image