It's because the alpha channel is not resized in the same manner. If you view the alpha separately, you will see the problem
not a very smooth zoom either ; I think someone made a smoother zoom function here, maybe riffraff42 or gavino ? Eitherway it's a lot smoother in a NLE or compositing tool
https://forum.doom9.org/showthread.php?t=168266
Code:
a=FFVideoSource("video.mp4").converttorgb32
function res(clip clip, clip "LClip", int "width", int "height",
\ int "centerX", int "centerY") {
LClip = BicubicResize(LClip, width, height)
Overlay(clip, LClip, centerX-LClip.Width/2, centerY-LClip.Height/2)
}
function resize(clip clip, clip "LClip",
\ int "start_frame", int "start_width", int "start_height",
\ int "end_frame", int "end_width", int "end_height",
\ int "centerX", int "centerY") {
return Animate(start_frame, end_frame, "res",
\ clip, LClip, start_width, start_height, centerX, centerY,
\ clip, LClip, end_width, end_height, centerX, centerY)
}
b = ImageSource("title.png",pixel_type="RGB32").assumefps(framerate(a))
black=BlankClip(b)
b2=resize(black, b,
\ 0, 5, 5,
\ 300, 1280, 720,
\ b.Width/2, b.Height/2)
b3=resize(black, b.showalpha,
\ 0, 5, 5,
\ 300, 1280, 720,
\ b.Width/2, b.Height/2)
overlay(a, b2, mask=b3)
trim(0,500)