agentleFS
AlphaSaleAidanAlphaSaleAidan/pierce-skill-kit/skills/ai-video-logo-replace/SKILL.md

ai-video-logo-replace

Skill0 starsChanged 29 days agoMITView on GitHub

Use when an AI-generated video clip came back with the wrong logo, brand, or label printed on props (boxes, signs, shirts, packaging) and re-generating would cost credits or lose a good take — or when a label must be swapped on a clip without touching hands and lighting.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't re-roll a good generation for a wrong logo.

    line 9
  2. Distinctive:

    Only print marks the client is allowed to use (their own brand or licensed ones).

    line 13

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AI video logo replace

Overview

Don't re-roll a good generation for a wrong logo. If the print is one consistent ink colour, you can detect it per frame (HSV), track it, inpaint it away and print your own mark in its place — shaded by the surface underneath (multiply blend), hands excluded. Zero credits, minutes of CPU.

Only print marks the client is allowed to use (their own brand or licensed ones).

When it works / when not

  • Works: printed labels on mostly-static or slowly moving props, one saturated print colour that appears nowhere else in frame (e.g. green on cardboard).
  • Doesn't: logos in the same colour as the scene, heavy motion blur, fast rotation past ~45°, prints wrapping around curved surfaces. Then regenerate the still with the right label and re-run i2v.

Steps

  1. Probe first. Grab 4–6 frames across the clip (start, middle, end, the frame with the smallest and largest print). Threshold in HSV and LOOK at the mask; tune --hsv-lo/--hsv-hi until every print is one blob and nothing else is.
  2. Assets. The new mark as an RGBA PNG (alpha = shape; the script re-inks it), the wordmark font (the brand's typeface or the closest free one), the wordmark text, the ink colour.
  3. Run:
    python scripts/logo_swap.py --in gen/boxes.mp4 --out gen/boxes_swapped.mp4 \
      --mark brand/mark.png --font fonts/Inter.ttf --text "Brand" \
      --hsv-lo 28,35,20 --hsv-hi 55,255,255 --ink 1a1a1a
    Per frame: HSV mask → morph CLOSE (45×75 ellipse, fuses icon + word) + dilate → contours ≥800 px² → minAreaRect → greedy IoU tracking + EMA (α 0.45) so the label doesn't jitter → TELEA inpaint of the print + its padded footprint → label contain-fit into the rotated rect, perspective-warped, multiply-blended over the inpainted surface, 1 px blur → skin-coloured pixels never painted.
  4. Verify at client zoom (video-qc-reviewer): crops ≥550 px of the smallest and largest print at start/mid/end; no leftover coloured fringe; hands passing in front stay on top; label doesn't swim. It printed detections/frame min/avg/max — a min of 0 on frames that show a print = missed frames.

Parameters worth knowing

KnobDefaultWhy
no MORPH_OPEN—distant prints are 1–2 px strokes; an open erased them (h 132 → 49 px) and left a fringe
PAD_FRAC0.14label must fully cover the old print
MAX_MISSED_RENDER / DROP1 / 4keep painting through a one-frame detection miss
inpaint maskgreen px ∪ padded track quadanti-aliased fringe outside the threshold otherwise leaks a tint
label fitcontain, own aspectstretching the mark into an oval is the first thing a client sees

What FAILED / pitfalls

  • MORPH_OPEN to clean noise: erased small prints (see table). MIN_AREA does the noise job.
  • Inpainting only the thresholded pixels: tinted halo around the new label.
  • Stretching the label to the detected rect: oval logos.
  • Painting over hands that pass in front of the box: add the skin mask; tune it to the clip's light.
  • This is not a learned tracker: fine for static boxes; upgrade (optical flow / a detector) only when a clip visibly defeats it.

Status

Generalized from the script used on the job (where it ran on the full clip); untested as generalized.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.