# 1. Save this program as 'textclip_moviepy.py'
# 2. Put a jpg image in the same file directory, name it as 'snowy_forrest.jpg'
# 3. To execute the program, $ python textclip_moviepy.py
from moviepy.editor import *
image_clip = ImageClip("snowy_forrest.jpg")
text_clip = TextClip(
text="Welcome to the world!".upper(),
size=(.8*image_clip.size[0], 0),
font="Helvetica-Narrow",
color="black",
bg_color="transparent"
)
# text_clip = text_clip.with_position('center')
text_clip = text_clip.with_position((0.15,0.55), relative=True)
final_clip = CompositeVideoClip([image_clip, text_clip])
final_clip.save_frame("textclip_moviepy.png")
Expected Behavior
Only one text clip on top of the image,
The background color is transparent.
Actual Behavior
Two text clips display.
The one text clip at the initial corner of the image with non-transparent background color.
Steps to Reproduce the Problem
Save this program as 'textclip_moviepy.py'
Put a jpg image in the same file directory, name it as 'snowy_forrest.jpg'
To execute the program, $ python textclip_moviepy.py
Specifications
Python Version: 3.9.12
MoviePy Version: 1.0.3
Platform Name: macOS Monterey 12.2.1, on MacBook Pro M1
Expected Behavior
Actual Behavior
Steps to Reproduce the Problem
Specifications