Log in
TechniqueBy HypernaturalVersion 1, updated

Check title occlusion

hn/python-check-title-occlusion

Measure how much of each title behind a person the person hides: for every text, image or path layer between the footage and the person cutout in an hn4a-compositor spec, every 2nd frame it is on, the share of its ink the cutout covers, through every camera, shake and group that moves either. Reports the worst share and when, and fails any layer over 0.2. Free and local. Run after every build of type-behind-people, before the live spec goes to the person.

SKILL.md

Give it a compositor spec with a person cutout drawn over titles; get, per title, the largest share of its ink the person hides on any frame, and when. The rule it checks: type behind a person may be a little hidden (a shoulder over one letter, part of one), never a word. A still per effect catches the obvious cases; this catches the frame a head moves into a word between two stills.

Inputs

  • The spec, with ids on the footage layer and on the person cutout drawn over the titles (python-track-face-and-hands, or birefnet-matte for a shot's cutout).
  • Its assets where the spec points.

Run it

Write references/occlusion.md's script into the job's scripts/ as occlusion.py, as is, and run it with cwd the job folder:

exec python scripts/occlusion.py --spec titles/cut.json --footage footage --cutout person_cutout --every 2 --limit 0.2

--skip leaves out layers by id that are meant to sit on the person (a light spill).

It renders the cutout alone and each checked layer alone, each on black and on white, with the groups they sit in, so the cam punch-ins and shakes move both exactly as in the cut; the two backgrounds give every pixel's alpha. Each layer's frames are rendered once, at 2 browsers; a spec with 2 titles over 11 s took 46 s.

What you get

A line per layer (ok or OVER, the worst share and its time) and occlusion.json; exit status 1 when any layer is over the limit.

Tips and traps

  • 0.2 is the line. A title beside the head with its first letter behind the hair measured 11%; one across the face, 82%.
  • Fix by moving, not by thinning the matte. A title that won't fit beside the head goes in front of the person, in the lower third over the body, or above the eyes over the hair. In an overscanned camera, keep a wide word's centre 400 px or more from the frame edges so a punch-in doesn't push it off.
  • Fades in and out are skipped below 200 px of ink, so a title's first faint frame doesn't count as hidden.
  • Only the layers between the footage and the cutout are checked; titles in front of the person can't be hidden by them.

Check it

Open the worst frame it names (hn4a-compositor still --at) and look: the share should match what you see. Re-run after every change to the titles or the cut.

FAQs

Measure how much of each title behind a person the person hides: for every text, image or path layer between the footage and the person cutout in an hn4a-compositor spec, every 2nd frame it is on, the share of its ink the cutout covers, through every camera, shake and group that moves either. Reports the worst share and when, and fails any layer over 0.2. Free and local. Run after every build of type-behind-people, before the live spec goes to the person.

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/hn/python-check-title-occlusion) and it installs hn/python-check-title-occlusion and follows it.

Nothing. The skill is free and runs with tools on your own Mac, like python, ffmpeg and hn4a-compositor.

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