← lab · model path · heatmap
Plugin math
passthrough
α(x)=1. Measures upload + composite overhead.
chroma-key-ycbcr
Y=0.299R+0.587G+0.114B, Cb=0.5+(B−Y)·0.564, Cr=0.5+(R−Y)·0.713. d=‖CbCr−key‖₂. α=smoothstep(t0,t1,d). Spill desaturates residual key color. Fails without a cyc — including the book-club sample.
hsv-distance
Circular hue distance dh=min(|h−h0|,1−|h−h0|). bg=hueGate·satGate·valGate. α=1−bg.
difference-plate
d=‖I−P‖₂ or max_c|I_c−P_c| or ‖CbCr(I)−CbCr(P)‖. α=smoothstep(t0,t1,d). Capture P once on the GPU.
morphology
3×3 min (erode) / max (dilate). Open=min∘max. Close=max∘min.
guided-upsample
Dual Kawase 5-tap downsample of α. Upsample α̂=∑ w_i α_i / ∑ w_i with w_i=exp(−|Y(I)−Y(I_i)| λ).
temporal-iir
α_t=(1−λ)α_{t−1}+λ α̂_t on ping-pong FBOs.
mediapipe-selfie
Selfie Segmenter landscape float16, VIDEO mode, one shared ImageSegmenter. Tiny category mask → GPU texture. No getImageData/readPixels/getAsFloat32Array on the video.
decision-tree
if useChroma ∨ chromaEnabled → chroma (child key defaults); else if plate → difference; else selfie every N, optional mask-res open + guided up + IIR.
Hardware profiles
StatCounter Global Stats, July 2026, pageviews — not shipments. Mobile OS worldwide: Android 68.36%, iOS 31.6%. Mobile vendors: Apple 31.59, Samsung 19.13, Unknown 10.39, Xiaomi 10.11, Vivo 5.78, Oppo 5.69. Other Android OEMs (Huawei / Motorola / Google / Transsion / …) are not given their own %; they are the remainder of Android after those named vendors: 68.36 − 19.13 − 10.39 − 10.11 − 5.78 − 5.69 = 7.26. Platform: Mobile 52.57, Desktop 45.93, Tablet 1.5. Desktop OS: Windows 71.18, OS X 12.21, macOS 7.61, Linux 7.53, Chrome OS 1.47. Desktop profiles show OS-of-desktop shares, not a fake global phone %.
The Hardware card Emulator switch (default off) is required before any StatCounter profile throttle applies. Off: this real browser — native video size, skip 1, full-res mask, no profile budget; traces use profileId this-machine, share 0, emulator false. On: pick a device class. Profile budgets (skip-N, mask scale, tile cap, maxEdge, target fps) are lab throttles so a desktop box can approximate a low-end phone. They are not real device clocks. Applying a profile (except this-machine) downscales the video upload if the longer edge exceeds maxEdge (uniform scale, both axes; no 9:16 crop). this-machine is a control: detected UA / WebGL renderer, share 0. Auto-bench traces JSON includes profileId, sharePct, and emulator so rows can be weighted by pageview share. Regional stand-ins (USA / EU / China / India, low and mid) use sharePct 0 from Counterpoint March/Q1 2026 sales mix — they are not StatCounter global pageviews and must not be weighted as if they were.
Sources: mobile OS, vendor, platform, desktop OS. Regional stand-ins: PhoneArena / Counterpoint March 2026, Counterpoint Q1 2026 bestsellers, Counterpoint 12 Aug 2026 US.
Add a plugin
- Implement BgPlugin in src/lib/plugins/ (init/dispose/process, GPU textures only).
- Register it in src/lib/plugins/registry.ts createRegistry().
- Add a math blurb and optional paramsSchema sliders.
- Stay off getImageData / readPixels / getAsFloat32Array in the frame path.