04.05.2024, 09:46
Ahh,..
chroma_resize_enabled is always true, which calls _clip_chroma_resize, which calls vs_recover_clip_luma
which is:
which hopefully does the correct thing and is similar fast do Vapoursynth ShufflePlanes.
Cu Selur
chroma_resize_enabled is always true, which calls _clip_chroma_resize, which calls vs_recover_clip_luma
which is:
def vs_recover_clip_luma(orig: vs.VideoNode = None, clip: vs.VideoNode = None) -> vs.VideoNode:
def copy_luma_frame(n, f):
img_orig = frame_to_image(f[0])
img_clip = frame_to_image(f[1])
img_m = chroma_post_process(img_clip, img_orig)
return image_to_frame(img_m, f[0].copy())
clip = clip.std.ModifyFrame(clips=[orig, clip], selector=copy_luma_frame)
return clip
def chroma_post_process(img_m: Image, orig: Image) -> Image:
img_np = np.asarray(img_m)
orig_np = np.asarray(orig)
img_yuv = cv2.cvtColor(img_np, cv2.COLOR_RGB2YUV)
# copy the chroma parametrs "U", "V", of "img_m" in "orig"
orig_yuv = cv2.cvtColor(orig_np, cv2.COLOR_RGB2YUV)
orig_copy = np.copy(orig_yuv)
orig_copy[:, :, 1:3] = img_yuv[:, :, 1:3]
img_np_new = cv2.cvtColor(orig_copy, cv2.COLOR_YUV2RGB)
return Image.fromarray(img_np_new)
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.