How to add a masked text reveal with Claude

Two lines of dark headline rise one after the other from an invisible edge, each cut off sharply at the bottom of its own line until it lands.

Get this effect

  1. Switch to Code in your Claude Desktop App

  2. Install the skill (once)

    Show the prompt
    Install the Recharm video effects skill: download https://recharm-growth-staging.s3.us-east-2.amazonaws.com/website/downloads/recharm-video-effects.zip and unzip it into ~/.claude/skills
  3. Ask for the effect

    Add a masked text reveal to input.mp4
    Lines: GLOW STARTS, HERE

Several videos, several effects, one ask

Put your clips in the folder, mention them with @, and ask for everything at once. Claude runs one tested script after another on each clip, then joins them.

Add a masked text reveal to @clip1.mp4, put a sale badge on @clip2.mp4, give @clip3.mp4 a VHS look, then join all three with crossfades.

Settings you can change

Ask Claude to change any of these, or edit them at the top of the script.

SettingDefaultWhat it does
LINESGLOW STARTS, HEREThe headline, one entry per line.
START0.5Second the first line starts to rise.
STAGGER0.3Seconds between one line starting and the next.
RISE0.5Seconds each line takes to slide up.
SIZE0.09Text height as a share of the frame width.
Y0.09Where the first line's center sits (0 = top, 1 = bottom).
COLOR(25, 15, 50)Text color.

Without the skill

Don’t want to install the skill? Paste this prompt into Claude Code and Claude writes the script itself.

Show the prompt
Add a masked text reveal to input.mp4: a two-line headline, "GLOW STARTS" over "HERE", in Arial Black (or any heavy bold font) 9% of the frame width tall, deep ink color (25, 15, 50), centered across. Give each line its own invisible window 1.25 times the font size tall and the full frame width: the first window is centered 9% of the way down, the second sits directly under it. Each line starts just below the bottom edge of its window, hidden, and slides straight up into place over 0.5 seconds with an ease-out (fast start, soft landing); anything below the window's bottom edge is cut off, so the text appears to rise from behind an edge. The first line starts at 0.5 seconds, the second 0.3 seconds later, and both then stay to the end. Use Python with Pillow to draw the text and ffmpeg to put it on the video (don't rely on ffmpeg's drawtext filter), keep the audio, and save it as output.mp4.

Run it without Claude

This is the exact script we tested. Save it as masked-text-reveal.py and run:

python3 masked-text-reveal.py input.mp4 output.mp4
Show the script
#!/usr/bin/env python3
"""Masked text reveal: each line of a headline slides up into view from behind an invisible edge.

Usage: python3 masked-text-reveal.py input.mp4 output.mp4
Needs ffmpeg and Pillow (pip install pillow).
"""
import json
import math
import subprocess
import sys
from pathlib import Path

from PIL import Image, ImageDraw, ImageFont

LINES = ["GLOW STARTS", "HERE"]  # headline, one entry per line
START = 0.5              # second the first line starts to rise
STAGGER = 0.3            # seconds between one line starting and the next
RISE = 0.5               # seconds each line takes to slide up
SIZE = 0.09              # text height as a share of the frame width
Y = 0.09                 # where the first line's center sits (0 = top, 1 = bottom)
COLOR = (25, 15, 50)     # text color, a deep ink
FONTS = ["/System/Library/Fonts/Supplemental/Arial Black.ttf",    # macOS
         "/System/Library/Fonts/Supplemental/Arial Bold.ttf",     # macOS
         "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",  # Linux
         "C:/Windows/Fonts/ariblk.ttf"]                           # Windows
FONT_FILE = next((f for f in FONTS if Path(f).exists()), None) or sys.exit("No bold font found: add one to FONTS")


def line_strip(text, font, height):
    """One line drawn once, centered in a full-width strip."""
    img = Image.new("RGBA", (w, height))
    ImageDraw.Draw(img).text((w / 2, height / 2), text, font=font, anchor="mm", fill=COLOR)
    return img


def overlay(t):
    """Each line sits in its own window; until it rises, it waits just below the window's bottom edge, out of sight."""
    img = Image.new("RGBA", (w, h))
    for i, strip in enumerate(strips):
        p = min(max((t - START - i * STAGGER) / RISE, 0), 1)
        if p == 0:
            continue
        drop = round((1 - p) ** 3 * strip.height)  # how far below its window the line still is; ease out
        top = round(h * Y + i * strip.height - strip.height / 2)
        img.alpha_composite(strip.crop((0, 0, w, strip.height - drop)), (0, top + drop))
    return img


def probe(path):
    info = json.loads(subprocess.check_output(["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries",
                                               "stream=width,height,r_frame_rate:format=duration", "-of", "json", path]))
    s = info["streams"][0]
    num, den = s["r_frame_rate"].split("/")
    return s["width"], s["height"], s["r_frame_rate"], float(num) / float(den), float(info["format"]["duration"])


def render(src, out):
    """Draw overlay(t) on every frame of src and save to out, keeping the audio."""
    ff = subprocess.Popen(["ffmpeg", "-y", "-v", "error", "-i", src,
                           "-f", "rawvideo", "-pix_fmt", "rgba", "-s", f"{w}x{h}", "-r", rate, "-i", "-",
                           "-filter_complex", "[0:v][1:v]overlay=shortest=1,format=yuv420p[v]",
                           "-map", "[v]", "-map", "0:a?", "-c:v", "libx264", "-crf", "18", "-c:a", "copy", out],
                          stdin=subprocess.PIPE)
    for i in range(math.ceil(duration * fps)):
        ff.stdin.write(overlay(i / fps).tobytes())
    ff.stdin.close()
    if ff.wait():
        sys.exit("ffmpeg failed")


src, out = sys.argv[1:3]
w, h, rate, fps, duration = probe(src)
font = ImageFont.truetype(FONT_FILE, round(w * SIZE))
strips = [line_strip(line, font, round(font.size * 1.25)) for line in LINES]
render(src, out)

Find 3x winning ads

Recharm cuts your ad footage into tagged, searchable clips: hooks, testimonials, product shots. Find the shots that win, add the effect with Claude, and ship 3x more ad edits.

Start 14-day free trial