Overlays the Laughing Man logo from Ghost in the Shell: Stand Alone Complex onto faces in a webcam or video stream — a native Rust app that composites a multi-channel-SDF logo on the GPU.
A capture → detect → track → composite pipeline: a frame source (webcam, video file, or a synthetic test pattern) is scanned for faces, and the logo is drawn over each face by a Vulkan compositor. The logo is rendered from baked MTSDF atlases so it stays crisp at any size and its text ring can spin independently. The overlay stays level with the camera (it does not tilt with the head).
Requires a recent stable Rust toolchain.
cargo build --releaseOptional feature flags (off by default to keep the runtime build light):
| Feature | Enables |
|---|---|
detect |
The SCRFD ONNX face detector (pulls ONNX Runtime). Without it, a synthetic demo face drives the overlay. |
bake |
The laughing-bake tool + the mask module (pulls fdsm/usvg/resvg). Needed only to bake the logo atlases. |
Runs a synthetic scrolling test pattern with a procedural placeholder logo — nothing to install:
cargo run --release -- --test-patternThe real Laughing Man art is copyrighted and not included — supply your own laugh.svg. The logo
is composited as three layers, each a separate SVG baked into its own atlas (all in one shared
frame so they stay aligned):
| Layer | Contents | Purpose |
|---|---|---|
--static |
Rings, face features, cap, text band — everything except the rotating text | The still logo + the white face backing (derived at load) |
--text |
The circular quote only | Spins around the logo's centre |
--front |
Features + cap | Its silhouette occludes the ring so the cap reads as in front of the spinning text |
Split your laugh.svg into these three layer SVGs — each keeping only its own part (a vector editor
works, or delete the paths that don't belong to a layer). Name them laugh-static.svg,
laugh-text.svg, and laugh-front.svg, then bake them (the text layer is the slow one — thousands of
glyph segments):
cargo run --release --features bake --bin laughing-bake -- \
--static laugh-static.svg --text laugh-text.svg --front laugh-front.svgThis writes assets/static.mtsdf.png, assets/text.mtsdf.png, and assets/front.mtsdf.png
(--out-dir defaults to assets, --size to 1024, --range to 8). A single combined SVG can also
be baked with --svg <file>.
cargo run --release -- \
--logo-static assets/static.mtsdf.png \
--logo-text assets/text.mtsdf.png \
--logo-front assets/front.mtsdf.png--logo-frontis optional; omit it and the spinning text draws over the cap instead of behind it.- With only
--logo-static(no--logo-text), a single combined atlas is composited without a spinning ring. - With no logo flags at all, a procedural placeholder is used.
| Key | Action |
|---|---|
S |
Save a full-resolution screenshot (video + overlay) to screenshots/laugh_<timestamp>.png |
Esc / Space |
Quit |
| Flag | Effect |
|---|---|
| (default) | Capture from webcam device --source <index> (default 0) |
--video <file> |
Decode an mp4/mkv/… as the source (ffmpeg is auto-downloaded on first use) |
--test-pattern |
Synthetic scrolling pattern, no camera |
--size WxH |
Requested capture resolution (e.g. 1280x720); defaults to the camera's highest |
--list |
List capture devices and exit |
--probe |
Print capture dimensions + measured rate to stdout, no window |
Detection uses an SCRFD *_kps ONNX model and the detect feature. Without a model, a synthetic demo
face positions the overlay:
cargo run --release --features detect -- --model scrfd_500m_kps.onnx --video clip.mp4 \
--logo-static assets/static.mtsdf.png --logo-text assets/text.mtsdf.png --logo-front assets/front.mtsdf.pngLicensed under the MIT License.