View Full Version : Overlay Clip isn't working properly(?)
VideoMilk78
3rd May 2025, 01:17
I've been playing around with a script that overlays a cleaned clip wherever dirt is on the original and I've run into an issue where I can see the dirt through the cleaned clip? I have opacity set to 1 so this shouldn't be possible...
https://i.postimg.cc/NKZ3HTZw/temp-Image5py-Yt-E.avif (https://postimg.cc/NKZ3HTZw)
poisondeathray
3rd May 2025, 02:34
Post your script
Where is the mask ? Or how did you convert "wherever dirt is on the original" to the mask clip ?
The mask clip has to be 100% white for 100% affected areas, otherwise you will see dirt show through from the original . If that's the case, you'd have to fix the mask
VideoMilk78
3rd May 2025, 03:08
I just did a make diff mask between original and cleaned.
Mask=debugmask(clip,cleaned,bc=BlankClip(Cleaned),color=color_white).mt_expand().mt_expand().mt_expand().mt_binarize().mt_inflate().mt_inflate().mt_inflate().tweak(sat=0)
The shimmering through may be a colorspace issue (YUV vs RGB) with the mask colorspace.
Here a demo. Step through the frames:
A=BlankClip(pixel_type="YUV422P8",color=color_red).subtitle("A")
B=BlankClip(pixel_type="YUV422P8",color=color_lime).subtitle("B")
mask1=BlankClip(pixel_type="YUV422P8",color=color_black) #or color_white
mask2=BlankClip(pixel_type="RGBP8",color=color_black) #or color_white
o1=overlay(A,B,x=50,y=50, mask=mask1) #shimmering
o2=overlay(A,B,x=50,y=50, mask=mask2) #no shimmering
interleave (o1,o2)
Wilbert
5th May 2025, 21:16
I restored both your threads. There is no reason to delete them i would assume.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.