from moviepy .editor VideoClip, ColorClip, TextClip, CompositeVideoClip
import numpy as np
# === SETTING ===
W, H = 1920, 1080 # Full HD
duration = 10 # detik
TEXT = "TRON" # ganti teks kamu
# === 1. BACKGROUND HITAM ===
bg = ColorClip(size=(W, H), color=(0, 0, 0), duration=duration)
# === 2. BIKIN GRID TRON PAKAI PIXEL ===
def make_grid_frame(t):
# t = waktu 0 sampai duration
frame = np.zeros((H, W, 3), dtype=np.uint8)
# Gerakin grid ke arah kamera biar berasa jalan
offset = int((t * 120) % 60) # kecepatan grid
# Garis horizontal - makin jauh makin rapat = efek 3D
for i in range(0, H, 30):
y = int(i * 1.5 - offset * 2)
if 0 <= y < H:
brightness = int(255 * (1 - i/H)) # makin jauh makin redup
frame[y:y+2, :] = (0, brightness//2, brightness) # warna cyan
# Garis vertikal - efek perspektif
center_x = W // 2
for i in range(-15, 16):
x = int(center_x + i * 80 * (1 + offset/60))
if 0 <= x < W:
frame[:, x:x+2] = (0, 100, 255)
return frame
grid = VideoClip(make_grid_frame, duration=duration)
# === 3. TEKS NEON GLOW ===
# Lapisan 1: Glow blur gede
txt_glow = TextClip(
TEXT, fontsize=200, color='#00FFFF', font='Arial-Bold'
).set_duration(duration)
# Bikin blur manual dengan resize
txt_glow = txt_glow.resize(1.2).set_opacity(0.3)
# Lapisan 2: Teks utama tajam
txt_main = TextClip(
TEXT, fontsize=200, color='white', font='Arial-Bold',
stroke_color='#00BFFF', stroke_width=4
).set_duration(duration)
# Gabung glow + teks utama
txt_final = CompositeVideoClip([txt_glow, txt_main])
txt_final = txt_final.set_position('center')
# === 4. ANIMASI TEKS JALAN DARI JAUH KE DEPAN ===
# Mulai kecil di tengah, makin gede = efek masuk ke layar
txt_final = txt_final.resize(lambda t: 0.1 + 0.9 * (t/duration)).set_position('center')
# === 5. GABUNG SEMUA + EXPORT ===
final = CompositeVideoClip([bg, grid, txt_final])
final.write_videofile("tron_yron.mp4", fps=30, codec='libx264')