Log in
TechniqueBy @rebeccaVersion 1, updated

Soft side gradient for title cards

rebecca/python-title-card-soft-gradient

The dark side gradient behind on-screen title cards (myth/fact cards, lists, key lines) over live footage, with a soft blur under it: how far it reaches, how soft and dark it is, the blur, and easing its reach across a camera move, as code and settings that worked. Also hides weak generated detail in background people. Use when laying cards over wide shots, or when a person says the gradient should reach further or a background person looks funky.

SKILL.md

Cards sit on a dark gradient that comes in from one side of the frame. Getting its reach, softness and blur right makes the cards readable, keeps the speaker clear, and quietly hides weak detail in generated background people.

The gradient

Apply per frame (1920×1080, frames as float32 RGB arrays). g is the gradient's fade-in (0–1) at time t.

import numpy as np
from PIL import Image, ImageFilter

W, H = 1920, 1080
x = np.linspace(0, 1, W)


def side_grad(side, reach=0.62, soft=0.37, gamma=1.1, gmax=0.9):
    """Darkness 0..gmax, darkest at the edge it comes from; fades out `reach` of the width in."""
    r = np.clip((x - (1 - reach)) / soft, 0, 1) if side == "right" else np.clip((reach - x) / soft, 0, 1)
    return np.repeat(((r ** gamma) * gmax)[None, :, None], H, axis=0).astype(np.float32)


def ease(v):
    v = min(max(v, 0.0), 1.0)
    return v * v * (3 - 2 * v)


def reach_at(t, keys):
    """keys [[t, reach], ...]: the reach eased between keys (follows a camera move)."""
    if t <= keys[0][0]:
        return keys[0][1]
    for (t0, r0), (t1, r1) in zip(keys, keys[1:]):
        if t <= t1:
            return r0 + (r1 - r0) * ease((t - t0) / (t1 - t0))
    return keys[-1][1]


def apply(frame, grad, g, blur=0):
    a = frame
    if blur and g > 0:
        # soft blur under the gradient, strongest where it is darkest (a shallow-focus look behind the card)
        b = np.asarray(Image.fromarray(a.astype(np.uint8)).filter(ImageFilter.GaussianBlur(blur)), np.float32)
        m = np.clip(grad / max(float(grad.max()), 1e-6), 0, 1) * g
        a = a * (1 - m) + b * m
    return a * (1 - grad * g)

Draw the card on top (label, letter-spaced, with a short rule; text or list in a bold neue grotesk, white). Its panel is about 720 px wide, 110 px from the gradient's edge, and vertically centred.

Settings that worked

Usereachsoftgammablur
Close-ups, two-shots (default)0.620.371.10
Wide shots with people behind the card0.680.260.83 px
  • Reach: take it just short of the speaker. The person asked for it to reach "a little further"; 0.68 stopped just short of her.
  • Darker further out: a lower soft and gamma keep it darker for longer before it fades. That hid a background person whose generated face looked "a little funky".
  • Blur: 10 px was too blurry, 6 px was still "a little less blurry, please", and 3 px was approved. Blending by the gradient's own mask keeps the speaker sharp.
  • The same settings on every shot of the same framing, so the edge doesn't jump between shots. Show one shot first with two looks (darker, or darker plus blur) and apply the pick to all of them.
  • Across a camera push from a wide to a close-up, ease the reach with keys ([[move_start, 0.68], [move_end, 0.62]]) so it meets the close-up's value without a jump at the cut.
  • Keep the clip's audio: map the source's audio through when encoding.

Check

Look at a sheet of frames from every carded shot side by side: the gradient's edge should sit in the same place, the speaker's face should be outside it, and the text should be readable over the brightest background.

FAQs

The dark side gradient behind on-screen title cards (myth/fact cards, lists, key lines) over live footage, with a soft blur under it: how far it reaches, how soft and dark it is, the blur, and easing its reach across a camera move, as code and settings that worked. Also hides weak generated detail in background people. Use when laying cards over wide shots, or when a person says the gradient should reach further or a background person looks funky.

Install Hypernatural Desktop, a free Mac app, and connect it to Claude Code, Codex or Claude Desktop. Then describe the video you want and your agent finds the skill itself, or paste this page's link (https://hypernatural.ai/skill/rebecca/python-title-card-soft-gradient) and it installs rebecca/python-title-card-soft-gradient and follows it.

Nothing. The skill is free and runs with tools on your own Mac.

Yes. Ask your agent to adjust it for your job, or to save its own version. You can publish your version under your own handle so anyone can install it.

Go make something cool.

Install the app, open your agent, describe the video. That's the whole onboarding.

Sticker HypernaturalSticker BannerSticker TVBoy