---
title: "How to add a heart wipe with Claude (tested prompt and script)"
description: "A heart with a pink outline opens in the middle of clip A and swells past the edges of the frame, with clip B showing inside it. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/heart-wipe
---

# How to add a heart wipe with Claude

A heart with a pink outline opens in the middle of clip A and swells past the edges of the frame, with clip B showing inside it.

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

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

   ```
   Join clipA.mp4 and clipB.mp4 with a heart wipe
   Length of the transition in seconds: 1.0
   The heart's final width as a multiple of the frame diagonal; big enough that it clears the corners: 2.0
   ```

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

Put a sale badge on **@clip1.mp4**, give **@clip2.mp4** a VHS look, then join them with a heart wipe.

## 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                                                                                        |
| ----------- | ---------------- | --------------------------------------------------------------------------------------------------- |
| `D`         | `1.0`            | Length of the transition in seconds.                                                                |
| `END_SIZE`  | `2.0`            | The heart's final width as a multiple of the frame diagonal; big enough that it clears the corners. |
| `RIM`       | `(255, 64, 129)` | Color of the heart's outline.                                                                       |
| `RIM_WIDTH` | `8`              | Outline thickness in pixels.                                                                        |

## Without the skill

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

```
Join clipA.mp4 and clipB.mp4 with a 1 second heart wipe starting 1 second before A ends (so the result is 11 seconds for two 6 second clips). During the wipe, clip B shows inside a heart centered on the frame and clip A outside it. Draw the heart with Python and Pillow from the curve x = sin(t)^3, y = -(13cos(t) - 5cos(2t) - 2cos(3t) - cos(4t))/16 - 0.16 (t from 0 to 2*pi, 400 points), scaled by r and placed at the frame center, with r = p^2 x the frame diagonal, where p goes from 1/30 to 1 over the 30 frames, so it starts tiny and ends past every corner. Draw an 8 pixel pink (255, 64, 129) outline along the heart's edge. Don't use ffmpeg's drawtext. Use ffmpeg for the rest: match B's size and frame rate to A (30fps), crossfade the audio over the same 1 second, and save it as output.mp4 (H.264, yuv420p).
```

## Run it without Claude

This is the exact script we tested. Save it as `heart-wipe.py` and run:

```
python3 heart-wipe.py clipA.mp4 clipB.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Heart wipe: a pink-edged heart opens in the middle of clip A and grows until clip B fills the screen.

Usage: python3 heart-wipe.py clipA.mp4 clipB.mp4 output.mp4  (both clips need an audio track)
Needs ffmpeg, Pillow and numpy (pip install pillow numpy).
"""
import json
import math
import subprocess
import sys

import numpy as np
from PIL import Image, ImageDraw

D = 1.0                   # transition length in seconds
FPS = 30
END_SIZE = 2.0            # heart's final width as a multiple of the frame diagonal (enough to clear the corners)
RIM = (255, 64, 129)      # color of the heart's outline
RIM_WIDTH = 8             # outline thickness in pixels

a_path, b_path, out_path = sys.argv[1:4]
info = json.loads(subprocess.run(
    ["ffprobe", "-v", "error", "-select_streams", "v:0", "-show_entries", "stream=width,height:format=duration",
     "-of", "json", a_path], capture_output=True, check=True).stdout)
w, h = info["streams"][0]["width"], info["streams"][0]["height"]
offset = float(info["format"]["duration"]) - D
n = round(D * FPS)

# the classic heart curve, scaled to a width of 2 and centered on its own bounding box
HEART = [(math.sin(t) ** 3, -(13 * math.cos(t) - 5 * math.cos(2 * t) - 2 * math.cos(3 * t) - math.cos(4 * t)) / 16 - 0.16)
         for t in (i * 2 * math.pi / 400 for i in range(400))]

def frames(path, start):
    """The n frames from `start`, fitted to A's size, as RGB arrays."""
    raw = subprocess.run(
        ["ffmpeg", "-v", "error", "-ss", str(start), "-i", path, "-frames:v", str(n),
         "-vf", f"scale={w}:{h}:force_original_aspect_ratio=increase,crop={w}:{h},fps={FPS}",
         "-f", "rawvideo", "-pix_fmt", "rgb24", "-"], capture_output=True, check=True).stdout
    return np.frombuffer(raw, np.uint8).reshape(-1, h, w, 3)

def heart_frame(a, b, p):
    r = p * p * END_SIZE * math.hypot(w, h) / 2   # half the heart's width, easing in
    outline = [(w / 2 + x * r, h / 2 + y * r) for x, y in HEART]
    mask = Image.new("L", (w, h))
    ImageDraw.Draw(mask).polygon(outline, fill=255)
    img = Image.composite(Image.fromarray(b), Image.fromarray(a), mask)
    ImageDraw.Draw(img).line(outline + outline[:1], fill=RIM, width=RIM_WIDTH, joint="curve")
    return img.tobytes()

tail, head = frames(a_path, offset), frames(b_path, 0)
middle = b"".join(heart_frame(tail[i], head[i], (i + 1) / n) for i in range(n))

# A up to the transition, then the heart frames from stdin, then the rest of B; the sound crossfades underneath
subprocess.run(
    ["ffmpeg", "-y", "-v", "error", "-i", a_path, "-i", b_path,
     "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{w}x{h}", "-r", str(FPS), "-i", "-",
     "-filter_complex",
     f"[0:v]fps={FPS},trim=end_frame={round(offset * FPS)},setpts=PTS-STARTPTS,format=yuv420p,setsar=1[a];"
     f"[2:v]format=yuv420p,setsar=1[m];"
     f"[1:v]scale={w}:{h}:force_original_aspect_ratio=increase,crop={w}:{h},fps={FPS},"
     f"trim=start_frame={n},setpts=PTS-STARTPTS,format=yuv420p,setsar=1[b];"
     f"[a][m][b]concat=n=3:v=1:a=0[v];[0:a][1:a]acrossfade=d={D}[au]",
     "-map", "[v]", "-map", "[au]", "-c:v", "libx264", "-crf", "18", "-pix_fmt", "yuv420p", "-c:a", "aac", out_path],
    input=middle, check=True)
```

## More transitions

- [Barn door transition **Barn door transition**](https://www.recharm.com/effects/barn-door)
- [Blinds transition **Blinds transition**](https://www.recharm.com/effects/blinds-transition)
- [Block dissolve **Block dissolve**](https://www.recharm.com/effects/block-dissolve)
- [Blur transition **Blur transition**](https://www.recharm.com/effects/blur-transition)
- [Bounce transition **Bounce transition**](https://www.recharm.com/effects/bounce-transition)

## 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)
