Motion reveals what a still frame hides

Ghost Font Decoder is an open-source Python tool and cross-agent plugin that reads text hidden inside random-dot videos. It measures the counter-motion that defines each letter, reconstructs a clean reveal, optionally runs OCR, and returns both the recovered text and visual evidence.

Python 3.8+OpenCVDense optical flowOCRCodex pluginClaude Code pluginMIT

Ghost Font
Decoder

A case study by Haroon K MScroll to read ↓
Built with
PythonOpenCVNumPyFarnebäck FlowDIS FlowPhase CorrelationTesseractCodex SkillsClaude Plugins
The thesis

A paused ghost-font frame is designed to look like uniform noise. But the secret is not in any single frame — the message is the motion. Dense optical flow turns that motion into a measurable signal, so an agent can reveal, inspect, and state the hidden text with evidence.

See it move

Noise while paused. Language in motion.

The dots inside the glyphs move against the background. The decoder compares consecutive frames, removes the shared motion, aligns the drifting glyph region, and accumulates what remains until the phrase becomes visible.

View on GitHub →
01
The pipeline

How it works

The decoder treats the clip as a motion field, not a pile of images. Each stage isolates more of the coherent counter-motion that forms the hidden message.

01

Read the clip

Load consecutive grayscale frames from MP4, MOV, AVI, or WebM input. A stride and frame limit keep long or high-frame-rate clips practical.

02

Measure dense motion

Compute pixel-level optical flow using DIS or Farnebäck, capturing direction and magnitude across the entire random-dot field.

03

Remove background drift

Subtract the median flow vector so shared camera or dot-field movement falls away and counter-moving glyph pixels become the useful signal.

04

Register and accumulate

Phase correlation aligns the drifting glyph region before opposition scores are accumulated across time, preventing the letters from smearing.

05

Clean the reveal

Otsu thresholding produces the strong mask; a conservative faint-glyph pass recovers lower-energy characters, followed by morphological cleanup.

06

Verify and answer

Optional Tesseract OCR proposes text, while the agent visually checks revealed.png and the heatmap before stating the recovered message in chat.

02
Capabilities

One decoder, three ways to use it

The same motion-recovery engine works as a plain Python CLI, a Codex skill, and a Claude Code plugin.

Standalone CLI

Run python decode.py VIDEO and receive a cleaned reveal, a diagnostic heatmap, and OCR text when available.

Codex plugin

Attach a clip and ask what it says. The skill runs the decoder, inspects both outputs, renders the reveal, and states the text.

Claude Code plugin

Install from the bundled marketplace and call /ghost-decode, or simply ask Claude to decode the supplied video.

Claude.ai skill

A build script packages the decoder workflow as an uploadable skill zip for use with attached videos in Claude.ai.

Evidence-first output

Every successful agent run must display the reconstructed image and name the recovered text — never return paths alone.

Hard-clip fallbacks

Switch flow methods, skip frames, cap long inputs, or continue with visual inspection when Tesseract is unavailable.

03
Agent experience

From attachment to answer

The plugin makes the technical pipeline disappear behind one natural-language request while keeping the evidence visible.

Codex displaying the decoded phrase and revealed image after running Ghost Font Decoder
04
Under the hood

Designed for verification

The interesting engineering is not only revealing pixels — it is making the result dependable enough for an agent to answer clearly.

2
Flow methods
2
Reveal outputs
3
Tool surfaces
  • The original frame is never sent straight to OCR; every frame is intentionally noise, so motion recovery always comes first.
  • Median background subtraction isolates opposition to the dominant field movement instead of rewarding raw motion magnitude.
  • Phase-correlation registration keeps moving letter regions aligned before accumulation, improving the final mask.
  • The heatmap preserves weak evidence that the binary mask may reject, giving the agent a second source for ambiguous characters.
  • OCR remains optional. Visual inspection of both generated outputs is the final authority when recognition is absent or incomplete.
  • The repository ships its own example clip, ready-to-run decoder, cross-agent skills, fallback prompt, and MIT license.
By the numbers
1
Natural-language request to decode
0
Raw frames trusted as readable text
MIT
Open-source license