---
title: "How to add a sliced text reveal with Claude (tested prompt and script)"
description: "A big yellow \"GLOW\" arrives cut into five horizontal strips, alternate slices shoved left and right, that slide back together until the word reads whole. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/sliced-text-reveal
---

# How to add a sliced text reveal with Claude

A big yellow "GLOW" arrives cut into five horizontal strips, alternate slices shoved left and right, that slide back together until the word reads whole.

Made by the script on this page, from our own test clip.

## Get this effect

1. ### Switch to Code in your [Claude Desktop App](https://claude.com/download)

2. ### Install the skill (once)

   ```
   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 sliced text reveal to input.mp4
   Text: GLOW
   ```

## 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 sliced 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.

| Setting   | Default         | What it does                                                             |
| --------- | --------------- | ------------------------------------------------------------------------ |
| `TEXT`    | `GLOW`          | The word.                                                                |
| `START`   | `0.5`           | Second the first strip starts to slide.                                  |
| `STRIPS`  | `5`             | How many horizontal slices the word is cut into.                         |
| `STAGGER` | `0.06`          | Seconds between one strip starting and the next.                         |
| `SLIDE`   | `0.7`           | Seconds each strip takes to slide into place.                            |
| `OFFSET`  | `0.45`          | How far each strip starts from its place, as a share of the frame width. |
| `SIZE`    | `0.22`          | Text height as a share of the frame width.                               |
| `Y`       | `0.12`          | Where the word's center sits (0 = top, 1 = bottom).                      |
| `COLOR`   | `(255, 205, 0)` | Text color.                                                              |
| `OUTLINE` | `(25, 15, 50)`  | Outline color.                                                           |

## Without the skill

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

```
Add a sliced text reveal to input.mp4: the word "GLOW" in Arial Black (or any heavy bold font) 22% of the frame width tall, bright yellow (255, 205, 0) with a thin deep ink (25, 15, 50) outline 4% of the font size wide, centered across with its center 12% of the way down. Cut the drawn word into 5 equal horizontal strips. Each strip starts offset sideways by 45% of the frame width (the 1st, 3rd and 5th strips from the top to the right, the 2nd and 4th to the left) and slides back into place over 0.7 seconds with a strong ease-out (offset times (1 - progress) cubed), fading from transparent to full over the first 20% of its slide. The top strip starts at 0.5 seconds and each strip below starts 0.06 seconds after the one above, so the word is whole by 1.5 seconds and then stays to the end. Nothing is on screen before 0.5 seconds. 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 `sliced-text-reveal.py` and run:

```
python3 sliced-text-reveal.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Sliced text reveal: a word arrives cut into horizontal strips, offset left and right, that slide together into the full word.

Usage: python3 sliced-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

TEXT = "GLOW"                # the word
START = 0.5                  # second the first strip starts to slide
STRIPS = 5                   # how many horizontal slices the word is cut into
STAGGER = 0.06               # seconds between one strip starting and the next
SLIDE = 0.7                  # seconds each strip takes to slide into place
OFFSET = 0.45                # how far each strip starts from its place, as a share of the frame width
SIZE = 0.22                  # text height as a share of the frame width
Y = 0.12                     # where the word's center sits (0 = top, 1 = bottom)
COLOR = (255, 205, 0)        # text color, a bright yellow
OUTLINE = (25, 15, 50)       # thin outline 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 word_strips():
    """The word drawn once, then cut into equal horizontal strips, top to bottom."""
    font = ImageFont.truetype(FONT_FILE, round(w * SIZE))
    stroke = max(2, round(font.size * 0.04))
    x0, y0, x1, y1 = font.getbbox(TEXT, stroke_width=stroke)
    word = Image.new("RGBA", (x1 - x0, y1 - y0))
    ImageDraw.Draw(word).text((-x0, -y0), TEXT, font=font, fill=COLOR, stroke_width=stroke, stroke_fill=OUTLINE)
    cuts = [round(i * word.height / STRIPS) for i in range(STRIPS + 1)]
    return word.size, [(top, word.crop((0, top, word.width, bottom))) for top, bottom in zip(cuts, cuts[1:])]

def overlay(t):
    """Counting from the top, strips 1, 3, 5 come in from the right and 2, 4 from the left, each easing out and fading up as it slides."""
    img = Image.new("RGBA", (w, h))
    left, top = round((w - size[0]) / 2), round(h * Y - size[1] / 2)
    for i, (y, strip) in enumerate(strips):
        p = min(max((t - START - i * STAGGER) / SLIDE, 0), 1)
        if p == 0:
            continue
        side = 1 if i % 2 == 0 else -1
        shift = round(side * (1 - p) ** 3 * OFFSET * w)
        piece = strip.copy()
        piece.putalpha(piece.getchannel("A").point(lambda a: round(a * min(p / 0.2, 1))))
        img.paste(piece, (left + shift, top + y), piece)  # strips never overlap, so a plain paste is enough
    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)
size, strips = word_strips()
render(src, out)
```

## More captions and text

- [AI chat reply animation **AI chat reply animation**](https://www.recharm.com/effects/ai-chat-typing)
- [Animated bar chart **Animated bar chart**](https://www.recharm.com/effects/animated-bar-chart)
- [Animated checklist **Animated checklist**](https://www.recharm.com/effects/animated-checklist)
- [Animated line graph **Animated line graph**](https://www.recharm.com/effects/animated-line-graph)
- [Animated pie chart **Animated pie chart**](https://www.recharm.com/effects/animated-pie-chart)

## 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](https://www.recharm.com/get-started)
