---
title: "How to add a comparison table with Claude (tested prompt and script)"
description: "A white table rises over the bottom of the shot with \"Ours\" and \"Others\" columns, and four feature rows fill in one by one, each getting a green tick under Ours and a red cross under Others. Install one skill and ask Claude Code, or run the Python script we tested yourself."
url: https://www.recharm.com/effects/comparison-table
---

# How to add a comparison table with Claude

A white table rises over the bottom of the shot with "Ours" and "Others" columns, and four feature rows fill in one by one, each getting a green tick under Ours and a red cross under Others.

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 comparison table to input.mp4
   Us, them: Ours, Others
   Rows: 15% vitamin C, Fragrance free, Vegan formula, Under $30
   ```

## 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 comparison table 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                                          |
| ------------ | --------------------------------------------------------- | ----------------------------------------------------- |
| `US, THEM`   | `Ours, Others`                                            | The two column headings.                              |
| `ROWS`       | `15% vitamin C, Fragrance free, Vegan formula, Under $30` | The feature rows, top to bottom.                      |
| `START`      | `0.5`                                                     | Second the card rises in.                             |
| `FIRST_ROW`  | `1.0`                                                     | Second the first row appears.                         |
| `GAP`        | `0.5`                                                     | Seconds between rows.                                 |
| `TOP`        | `0.62`                                                    | Where the card's top edge sits (0 = top, 1 = bottom). |
| `GREEN, RED` | `(34, 197, 94), (230, 30, 45)`                            | Tick and cross circle colors.                         |

## Without the skill

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

```
Add a comparison table to input.mp4. Draw a white (255, 255, 255) card at 96% opacity with corners rounded by 4% of the frame width and a soft black shadow (35% opacity, 8 px lower, blurred by 12 px). It spans 4% to 96% of the frame width, its top edge sits 62% of the way down, and it holds a heading row and four rows, each 11% of the frame width tall, plus 3% of the frame width of padding at the bottom. The left 52% of the card holds the feature names; the next 24% is our column, filled with light purple (237, 228, 255) as a rounded strip inset 6 px from its sides and 8 px from the card's top and bottom; the last 24% is the other column. The heading row says "Ours" in purple (110, 60, 200) and "Others" in grey (120, 120, 130), bold, 5% of the frame width tall, centered in their columns. Thin light grey (225, 225, 232) 2 px lines separate the rows. The card rises 8% of the frame width into place while fading in over 0.3 seconds at 0.5 seconds. The rows are "15% vitamin C", "Fragrance free", "Vegan formula" and "Under $30", in dark (20, 20, 30) bold text 4.8% of the frame width tall, left-aligned 5% of the frame width in from the card's left edge; they appear at 1.0, 1.5, 2.0 and 2.5 seconds, each fading in while rising 12 px over 0.25 seconds. In each row, 0.15 seconds after the row appears a green (34, 197, 94) circle 7.5% of the frame width across with a white tick pops in at the center of our column, and 0.3 seconds after the row appears a red (230, 30, 45) circle the same size with a white X pops in at the center of the other column; each pop scales up from nothing over 0.2 seconds with a slight overshoot. Everything stays on to the end. Use Python with Pillow to draw it 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 `comparison-table.py` and run:

```
python3 comparison-table.py input.mp4 output.mp4
```

```
#!/usr/bin/env python3
"""Comparison table: a white card rises into the lower frame, then rows fill in, each with a green tick for us and a red cross for them.

Usage: python3 comparison-table.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, ImageFilter, ImageFont

US, THEM = "Ours", "Others"                  # column headings
ROWS = ["15% vitamin C", "Fragrance free", "Vegan formula", "Under $30"]
START = 0.5              # second the card rises in
FIRST_ROW = 1.0          # second the first row appears
GAP = 0.5                # seconds between rows
MARK_DELAY = 0.15, 0.3   # seconds after its row appears that the tick, then the cross, pops in
TOP = 0.62               # card's top edge (0 = top of frame, 1 = bottom)
ROW = 0.11               # row height as a share of the frame width
GREEN = (34, 197, 94)    # tick circle color
RED = (230, 30, 45)      # cross circle color
TINT = (237, 228, 255)   # background of our column
INK = (20, 20, 30)       # text color
FONTS = ["/System/Library/Fonts/Supplemental/Arial Bold.ttf",     # macOS
         "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",  # Linux
         "C:/Windows/Fonts/arialbd.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 ease_out(p):
    p = min(max(p, 0), 1)
    return 1 - (1 - p) ** 3

def ease_out_back(p):
    """0 -> 1 with a small overshoot past 1 before settling, which reads as a 'pop'."""
    p = min(max(p, 0), 1)
    return 1 + 2.70158 * (p - 1) ** 3 + 1.70158 * (p - 1) ** 2

def layout():
    """Card corners, the x centers of our and their columns, and the y center of each row."""
    x0, x1 = round(w * 0.04), round(w * 0.96)
    row = round(w * ROW)
    y0 = round(h * TOP)
    y1 = y0 + row * (len(ROWS) + 1) + round(w * 0.03)
    split = x0 + round((x1 - x0) * 0.52)              # the feature names take the left 52%
    us_x, them_x = split + (x1 - x0) * 0.12, split + (x1 - x0) * 0.36
    rows = [y0 + row * (i + 1) + row // 2 for i in range(len(ROWS))]
    return (x0, y0, x1, y1), split, us_x, them_x, row, rows

def card():
    """The empty table: shadow, white card, our tinted column, headings and row lines."""
    (x0, y0, x1, y1), split, us_x, them_x, row, rows = layout()
    radius = round(w * 0.04)
    img = Image.new("RGBA", (w, h))
    shadow = Image.new("RGBA", (w, h))
    ImageDraw.Draw(shadow).rounded_rectangle([x0, y0 + 8, x1, y1 + 8], radius, fill=(0, 0, 0, 90))
    img.alpha_composite(shadow.filter(ImageFilter.GaussianBlur(12)))
    draw = ImageDraw.Draw(img)
    draw.rounded_rectangle([x0, y0, x1, y1], radius, fill=(255, 255, 255, 245))
    us_right = split + round((x1 - x0) * 0.24)
    draw.rounded_rectangle([split + 6, y0 + 8, us_right - 6, y1 - 8], round(w * 0.03), fill=TINT)
    head = ImageFont.truetype(FONT_FILE, round(w * 0.05))
    draw.text((us_x, y0 + row / 2), US, font=head, anchor="mm", fill=(110, 60, 200))
    draw.text((them_x, y0 + row / 2), THEM, font=head, anchor="mm", fill=(120, 120, 130))
    for i in range(len(ROWS)):
        draw.line([x0 + 18, y0 + row * (i + 1), x1 - 18, y0 + row * (i + 1)], fill=(225, 225, 232), width=2)
    return img

def mark(kind, d, p):
    """A tick or cross in a colored circle d pixels across, scaled by p."""
    s = max(1, round(d * p))
    img = Image.new("RGBA", (d * 2, d * 2))
    if p <= 0.02:
        return img
    disc = Image.new("RGBA", (d, d))
    draw = ImageDraw.Draw(disc)
    draw.ellipse([0, 0, d - 1, d - 1], fill=GREEN if kind == "tick" else RED)
    stroke = max(3, d // 9)
    if kind == "tick":
        draw.line([(d * 0.27, d * 0.52), (d * 0.43, d * 0.68), (d * 0.74, d * 0.35)], fill="white", width=stroke, joint="curve")
    else:
        draw.line([(d * 0.32, d * 0.32), (d * 0.68, d * 0.68)], fill="white", width=stroke)
        draw.line([(d * 0.68, d * 0.32), (d * 0.32, d * 0.68)], fill="white", width=stroke)
    disc = disc.resize((s, s), Image.LANCZOS)
    img.alpha_composite(disc, (d - s // 2, d - s // 2))
    return img

def overlay(t):
    img = Image.new("RGBA", (w, h))
    if t < START:
        return img
    (x0, y0, x1, y1), split, us_x, them_x, row, rows = layout()
    p = ease_out((t - START) / 0.3)
    base = table.transform(table.size, Image.AFFINE, (1, 0, 0, 0, 1, -round((1 - p) * w * 0.08)))
    base.putalpha(base.getchannel("A").point(lambda v: round(v * p)))
    img.alpha_composite(base)
    font = ImageFont.truetype(FONT_FILE, round(w * 0.048))
    d = round(w * 0.075)
    for i, (name, cy) in enumerate(zip(ROWS, rows)):
        t0 = FIRST_ROW + i * GAP
        if t < t0:
            break
        q = ease_out((t - t0) / 0.25)
        layer = Image.new("RGBA", (w, h))
        ImageDraw.Draw(layer).text((x0 + round(w * 0.05), cy + round((1 - q) * 12)), name, font=font, anchor="lm",
                                   fill=INK + (round(255 * q),))
        img.alpha_composite(layer)
        for kind, cx, delay in (("tick", us_x, MARK_DELAY[0]), ("cross", them_x, MARK_DELAY[1])):
            m = mark(kind, d, ease_out_back((t - t0 - delay) / 0.2))
            img.alpha_composite(m, (round(cx) - d, cy - d))
    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)
table = card()
render(src, out)
```

## More product shots

- [Animated feature callouts **Animated feature callouts**](https://www.recharm.com/effects/animated-feature-callouts)
- [Before/after slider **Before/after slider**](https://www.recharm.com/effects/before-after-slider)
- [Best seller badge **Best seller badge**](https://www.recharm.com/effects/best-seller-badge)
- [Callout arrows and circles **Callout arrows and circles**](https://www.recharm.com/effects/callout-arrows-and-circles)
- [Carousel swipe **Carousel swipe**](https://www.recharm.com/effects/carousel-swipe)

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