This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
In In the Blink of an Eye, film editor Walter Murch asks why humans blink thousands of times a day when our eyes only need moisture a fraction as often. His answer is that a blink is a mental punctuation mark—the physical hinge where one thought cuts to the next, paced by our breathing. Before Your Eyes turned that reflex into loss, cutting away every scene the instant an involuntary blink landed.
I wanted to build a slower darkroom where you steer a five-scene memory essay with your eyes and chest—no keyboard—using one strict rule:
A blink is a cut, not a click.
A naive blink detector ruins reading because your eyelids twitch every few seconds while you are still halfway through a sentence. So AFTERIMAGE locks every beat for 4.2 s (Shutter Armed) on the Presage SmartSpectra SDK (@smartspectra/node-sdk@3.5.0) before a quick blink can turn the page. Across my 352.4 s live narrated sitting (670 keyframes in sample-trace.json), I blinked 64 times: the dwell gate rejected 30 early reading blinks (rippling the aperture silently instead of skipping prose) and let the other 34 cut cleanly whenever a page was armed (15 deliberate cuts completed the 239.2 s essay).
Between cuts, three involuntary signals run the room:
| Live SmartSpectra Signal | What Raw SDK Emits (30 Hz) | How AFTERIMAGE Processes It | Effect on Screen & Sound |
|---|---|---|---|
| Quick Blink Cut | face.landmarks (478 px pts) + face.blinking | Scale-invariant 6-pt EAR (< 0.21) fired on reopen (< 650 ms, 360 ms debounce) with a 0.25 EAR native-descent guard + 4.2 s dwell | Aperture click sound + cut across 15 beats (early blinks ripple instead of advancing) |
| Long Eye-Close Pause | Sustained low EAR (< 0.21 held ≥ 1.1 s) | Descent guard (lastEar >= 0.25) + ≥ 400 ms suppression stops native face.blinking pulses during long closures | Pauses / resumes sitting cleanly (4 live pauses verified without skipping beats) |
Horizontal Gaze (L / C / R) | Iris centers 468, 473 + nose/cheek yaw | Additive deviation (0.5 + irisDelta * 0.95 + yawDelta * 0.55), < 0.455 / > 0.545 + hysteresis | Smooth crossfade, sharper triptych panel, caption swap, stereo WebAudio pan |
| Chest Breath & Phase | breathing.upperTrace + breathing.rate + face.talking | 4.5 s OLS linear detrend + 2nd-diff curvature steadiness + ≥ 5-frame talking guard (807/807 checks live) | Clears SVG blur (feGaussianBlur), slows drift, swells pink-noise bed; ≥ 60% chimes & reveals hidden note |
| Tonal Echo | face.expression (HAPPY, SAD, FEAR, ANGRY, NEUTRAL) | 0.82/0.18 warm (≥ 45%), 0.90/0.10 heavy (≥ 86%) EMA for downward laptop camera angles | Subtle light warmth & ambient chord detune (neutral / warm / heavy) |
| 478-Point Silhouette | Raw face.landmarks ([316..564, 10..350] px) | Normalized to [0..1] oval/eye geometry on the Node bridge | Vector rangefinder reticle on /calibrate (zero camera pixels in browser DOM) |
What a Plate Actually Reads Like
On Plate I (Morning Steam · Kitchen table · 06:14 AM), opening Beat 1 puts an untouched kitchen table in front of you:
First light slips between the blind slats onto an empty kitchen table. Nobody has spoken yet; the kettle only stopped whistling a minute ago.
Shifting your eyes Left, Center, or Right swaps which detail sharpens and which caption speaks:
- Left — Venetian Blinds: "Dust rises slowly through four narrow bands of early light."
- Center — Ceramic Cup: "Steam still curls off the dark surface untouched since six."
- Right — Folded Note: "Half a sentence pressed into napkin paper beside the spoon."
Settle your chest breath past 60% steadiness and a two-note chime wakes a hidden cobalt line underneath:
Marginalia developed: “You meant to finish packing last night, then stood here twenty minutes just listening to the refrigerator hum.”
That breath lock never fakes itself. Across my silent Sitting 2 (205.5 s), Plates III and IV dropped in steadiness and honestly unlocked only 1/3 notes (11/15 total). Across my spoken Sitting 3 (239.2 s), talking while narrating held the freeze cleanly (72% average clarity, 15/15 notes unlocked), while in an earlier dark-theme rehearsal (Solar Coral, 194.7 s, 57% clarity) losing the chest trace on Plates II–IV drew flat dashed lines (0/3 notes) instead of guessing a wave.
Demo
- Try it in your browser (no camera or key needed): https://afterimage-presage.vercel.app Because
@smartspectra/node-sdkis a native desktop C++/FFI addon, the hosted Vercel app boots directly into Recorded Sample Trace mode—replaying the exact670-keyframe (352.40 sspan) narrated Windows capture at 1× speed—plus Keyboard Interactive Mode (Space,←/↑/→,Shift).
The first two screenshots below are captured running the bundled Recorded Sample Trace on the built frontend; Step 03 and the dark-theme Solar Coral Contact Sheet were exported directly from live Windows webcam sittings:

Step 01 (/calibrate, Recorded Sample Trace): Explicit camera consent, concise §7.4 cardioMetrics opt-in disclosure, and 478-point geometric silhouette reticle (Chest Wave 72%).

Step 02 (/experience, Recorded Sample Trace): FOCUS SHARP · 87%, SHUTTER ARMED · BLINK TO CUT, Center Ceramic Cup sharp, and cobalt marginalia unlocked.

Step 03 (/contact-sheet, Sitting 3 live narrated export): 239.2 s, 15 blink cuts, 72% breath clarity, AVG PULSE 75.4 BPM (§7.4), mixed L / C / R gaze bars, and 15/15 notes unlocked.
What Sitting 3 reveals at a glance:
- Live speech protection (
807 / 807checks): Speaking aloud across15narrated episodes (57keyframes insample-trace.json) kept chest steadiness cleanly locked (72%avg clarity,15/15hidden notes) with0drift violations. - Honest opt-in pulse gating (
75.4 bpmavg): After flippingcardioMetricsON mid-sitting, Plates II–IV print71.8 / 77.1 / 77.2 bpm, while Plate I (pre-toggle) and Plate V (where the ~95% gray Left bar shows looking far left, dropping rPPG confidence< 40%) stay honestly blank (null). - Telemetry caught one last edge case: Long-blink pause #3 (
dt = 289.947 s,ear = 0.213) exposed a42 mseyelid-descent race right before a2.44 sclosure hold, fixed bynativeBlinkEarFloor = 0.25and locked in by Regression Test #21.

Dark-theme **Solar Coral* variant (194.7 s, 57% breath clarity): when chest signal stalled on Plates II–IV, the sheet drew honest dashed baselines (0/3 notes) rather than smoothing over the gap.*
Code
AFTERIMAGE
A blink is a cut, not a click. Breathe steady to hold the frame still.
AFTERIMAGE is a five-scene interactive visual essay navigated without touching a keyboard, powered by the Presage SmartSpectra Node.js SDK (@smartspectra/node-sdk@3.5.0). Inspired by film editor Walter Murch's In the Blink of an Eye (the observation that a human blink punctuates one thought from the next alongside the rhythm of breathing) and the blink-driven memory storytelling of Before Your Eyes, AFTERIMAGE turns involuntary webcam signals into slow darkroom controls: where you look shifts focus across a three-panel plate, chest breathing steadiness clears optical haze and develops hidden marginalia, and every natural blink turns the page once a 4.2 s Shutter Armed dwell lock clears—ending in an exportable Contact Sheet (.png) of your sitting.
Built as a solo submission for the Presage SmartSpectra SDK Challenge.
- Interactive Preview (Vercel): https://afterimage-presage.vercel.app…
MIT licensed. Tested on Windows x64 (Node v24.9.0, integrated webcam USB\VID_13D3&PID_5415 at 960×540 @ 30fps, @smartspectra/node-sdk@3.5.0). GitHub Actions CI runs all 21 unit tests, verify-trace (which asserts every sitting number reported in this post against committed web/public/sample-trace.json plus SDK privacy invariants), and the production Vite build on every push:
git clone https://github.com/emarc99/presage-dev.git cd presage-dev npm install && npm --prefix web install cp .env.example .env # Add SMARTSPECTRA_API_KEY=... npm run check # 21 unit tests + verify-trace + frontend build npm start # Starts localhost bridge & UI on http://127.0.0.1:4199 How It Responds to Human Signals
Rather than piping raw SDK packets straight into React state, bridge/signal-processor.mjs transforms them into scale-invariant events. Every rule came from running it on my own laptop camera and watching what broke first.
Sitting 1 → Sitting 2 → Sitting 3: What Broke and What Fixed It
| Run | Duration & Frames | Breath Clarity | Gaze Split (L / C / R) | Notes Unlocked | What Broke & What Fixed It |
|---|---|---|---|---|---|
| Pre-flight probe | 0 s (kInputUnavailable) | — | — | — | CameraSelection.front failed on Windows; checkDeviceReadiness() tore down sessions for 30 s. Switched directly to CameraSelection.default / .byId() (~7 s lock at 29–31 Hz). |
| Sitting 1 (broken pipeline) | 151.4 s, 15 blink cuts | Froze at 55% on startup (67% after clearing) | 100% Center (0.486–0.493) | 15/15 | 30 Hz availableCameras() + validationStatus storm starved React; 1-frame startup face.talking froze 55%; 0.7*iris + 0.3*yaw pinned gaze at Center. |
| Sitting 2 (silent calibrated) | 205.5 s, 366 keyframes (308 breathRate msgs) | 63% 5-plate avg (63.9% trace mean, 37–85%) | 91 Left / 235 Center / 40 Right | 11/15 (3,3,1,1,3) | Cached camera list, deduplicated status broadcasts, ≥ 5-frame talking guard, OLS detrending, additive iris+yaw deviation (0.95 / 0.55). 26 raw blinks → 11 early ripples + 15 cuts. |
| Solar Coral rehearsal (dark theme) | 194.7 s, 15 blink cuts | 57% 5-plate avg (stalled wave on II–IV) | Mixed L / C / R on Plate V | 2/15 (0,0,0,0,2) | Chest tracking dropped on Plates II–IV; drew honest dashed flatlines instead of fake curves while validating dark Solar Coral styling. |
| Sitting 3 (narrated demo capture, exported above) | 239.2 s essay / 352.4 s 670 keyframes (9,827 30 Hz msgs at 29.5 fps, 523 breathRate msgs) | 72% 5-plate avg (72.4% trace mean, 45–89%) | 171 Left / 406 Center / 93 Right | 15/15 + opt-in 75.4 bpm (71.8 / 77.1 / 77.2) | Proven live: 807/807 talking-guard freeze checks across 15 speaking episodes (57 talking keyframes, 0 violations), 64 raw blinks (30 early + 34 armed across 352.4 s), opt-in pulse honestly null < 40% on Plates I & V, and 4 long-blink pauses exposing the 42 ms eyelid-descent race (dt = 289.947 s, ear = 0.213, fixed + Test #21). |
Comparing the earlier Contact Sheets side-by-side makes each calibration step concrete—first Sitting 1 trapped in 100% cobalt CENTER, then Sitting 2 unlocking multi-zone L / C / R gaze (91 / 235 / 40) while staying honest about two wavering breath plates (1/3 on Plates III–IV), before Sitting 3 in Demo above:

Sitting 1 (151.4 s): Blinks and chest breath worked once past the startup freeze, but 0.7 * iris + 0.3 * yaw trapped gazeScalar in [0.486..0.493]—100% Center across all five plates.

Sitting 2 (205.5 s, 366 silent keyframes): Additive iris+yaw (0.95 / 0.55) unlocked Left/Center/Right bars (91 / 235 / 40), Plates III–IV honestly read 1/3 notes during unsteady breath beats (11/15 total), and cardioMetrics stayed OFF.
What Real Windows Runs Taught Me
(Full technical log of all 10 hardware/SDK measurements: docs/SDK-NOTES.md.)
- Windows lied about the camera, and
checkDeviceReadiness()stalled for 30 s. Windows MediaFoundation reports integrated laptop cameras (USB\VID_13D3&PID_5415) withfacing="unknown"andlensType="unknown", soCameraSelection.frontfails immediately withkInputUnavailable. Callingsdk.checkDeviceReadiness()also tears down any active session and waits 30 seconds onreference720p30('full'). LaunchingCameraSelection.defaultdirectly at960×540 @ 30fpslocks at29–31 Hzin ~7 seconds. - Landmarks arrived in raw pixels (
[316..564, 10..350]), not[0..1], so blinks and glances needed local geometry. Unlike browser MediaPipe builds,@smartspectra/node-sdkoutputs all 478 landmarks (including iris centers468and473) in raw frame pixels—which also explains whytimothy_akanbi's Long Exposure found raw blink flags and coordinates tricky for blinks. Dividing eyelid gap by eye-corner width puts open eyes cleanly atear ≈ 0.298–0.313(< 0.21closed) and triggering cuts on reopen (< 650 ms) avoids firing when someone closes their eyes (≥ 1.1 s) to pause. Replacing0.7 * iris + 0.3 * yawwith additive deviation around center (0.5 + irisDelta * 0.95 + yawDelta * 0.55,< 0.455 / > 0.545) immediately turned Sitting 1's 100%-Center wall into mixed L/C/R gaze splits (91 / 235 / 40in Sitting 2;171 / 406 / 93in Sitting 3). - Auto-exposure collapsed brightness, dragging chest breathing across
[-6.842..+3.256]. When USB camera drivers lack manual AE lock, SmartSpectra logsmediafoundation_camera_source.cc:3019 [exposure-topup] lock collapsed image brightness (luma=18.8254 vs pre-lock 81.3485) ... exposure reverted to AUTO. That auto-exposure drift plus subtle posture lean sendsbreathing.upperTracesliding down a 10-unit ramp, andupperTrace.stablestaysfalsefor ~20 s waiting onbreathing.rate. Fitting a rolling4.5 sOrdinary Least Squares (OLS) linear detrend and scoring 2nd-difference curvature RMS directly responds within ~3 seconds while preservingbreathPhase. - A 30 Hz status storm and a 1-frame startup flicker froze Sitting 1. Like
samarth_kumble's Practical noticed on Windows,validationStatusfires on every single video frame (~25–30×/sec) even whilekOknever changes—and callingSmartSpectraSDK.availableCameras()inside the status builder triggered 30 MediaFoundation enumerations/sec alongside 60 Hz SVG blur renders, while one strayface.talking: truepacket froze breath warmup at55%and downward laptop angles readSAD: 64.1%–97.6%at rest. Caching cameras, deduplicating(validation, validationHint), throttling UI updates to~12.5 Hz, gating talking on5consecutive frames, and smoothingheavyat≥ 86%cured all three. - Recording my demo sitting caught one more bug (the 42 ms eyelid-descent race)—and proved the talking guard and pulse gate live. Speaking on camera across Sitting 3 proved the speech guard end-to-end: across
15speaking episodes (822talking packets at29.5 fps,57keyframes insample-trace.json),breathSteadinessstayed locked across807 / 807consecutive talking checks with0violations. Opt-incardioMetricsalso behaved honestly once flipped ON mid-sitting (dt = 264.6 s): Plates II–IV printed71.8 / 77.1 / 77.2 bpm(75.4 bpmavg), while Plate I (pre-toggle) and Plate V (extreme left gaze pushing rPPG confidence< 40%) stayed suppressed (null). Out of4long-blink pauses (157.86 s,259.14 s,291.11 s,320.69 s), pause #3 exposed one subtle race: nativeface.blinkingfired atdt = 289.947 s(ear = 0.213,0.003above the0.21closure cutoff) 42 ms beforeeardropped to0.175at289.989 sfor a2.44 shold. Gating nativeface.blinkingfallback onlastEar >= 0.25(nativeBlinkEarFloor) eliminates descent misfires without breaking partial-blink fallback, locked in by Regression Test #21.
// Excerpt from bridge/signal-processor.mjs — native blinking descent guard (Test #21) const nativeEarClear = this.lastEar === null || this.lastEar >= this.nativeBlinkEarFloor; if (!this.wasLowEar && nativeEarClear && !this.longBlinkFired && closedElapsed < 400) { blinkCut = true; } Honest Limits
- Single person, single laptop (
n = 1): Every live sitting and threshold in this post was calibrated on me in front of one Windows x64 laptop webcam in indoor lighting; it has not yet been tested on macOS/Linux or across Fitzpatrick V–VI skin tones. - No packet capture on Presage's §7.4 gateway: The Consent section below states strictly what Presage's SDK 3.5.0 source code and docs specify rather than claiming a wire-level network audit.
Prize Categories
I am entering Most Creative or Delightful Use (in addition to Overall consideration):
Directly inspired by Walter Murch's In the Blink of an Eye and Before Your Eyes, AFTERIMAGE turns contactless webcam sensing from a vitals chart into slow darkroom cinema: an eye glance shifts panel sharpness and stereo WebAudio harmonies, calm chest breathing clears SVG optical haze to wake hidden italic marginalia (15/15 unlocked on Sitting 3, honestly stalling to dashed flatlines when signal drops), a 4.2 s dwell gate turns ordinary blinks from nuisance triggers into deliberate film cuts (30 reading blinks absorbed cleanly so 34 intentional cuts told the story), and the sitting ends by printing an honest 1600×920 Contact Sheet you can download or erase in one click.
Consent and Data Handling
- Camera stays off until explicit consent: Video capture never starts on load. On
/calibrate, Live Bridge mode requires checking consent and clicking to start; closing or navigating away stops capture cleanly. - No raw video or audio stored: Native Node decodes camera frames locally at
960×540 @ 30fpson127.0.0.1:4199and discards them from RAM immediately. Only normalized[0..1]geometric silhouette vectors and scalar blink/gaze/breath values traverse localhost WebSocket. Microphone permission is never requested. - SDK telemetry OFF &
requestInsight()never called:bridge/server.mjsconstructs every SDK instance withenableTelemetry: falseand never callssdk.requestInsight(). Both invariants are asserted on every CI push innpm testandnpm run verify-trace. - Accurate Presage §7.4 LLM Insights disclosure: Leaving
cardioMetricsOFF by default requests onlyfaceMetrics + breathingMetrics, so pulse and HRV are never computed or buffered. However, inspection of Presage's LLM Insights docs, Privacy Policy §7.4, and@smartspectra/node-sdk@3.5.0source (_ensureSession()registersonInsightunconditionally) shows that whenbreathing.rate(orcardiowhen enabled) is active, the SDK automatically dispatches short derived numeric series (never raw video) to Presage's Analytics Gateway / Anthropic LLM service and cannot currently be turned off by developers. AFTERIMAGE discloses this plainly upfront on/calibrate, never requests or displays AI insights, and warns inline before opt-incardioMetricsis switched ON (plus suppressing< 40%confidence pulse readings due to camera rPPG sensitivity in dim lighting and Fitzpatrick V–VI skin tones). - Opt-in trace recording & one-click erasure: Local trace recording (
.jsonlinside gitignoredrecordings/, orweb/public/sample-trace.json) runs only when explicitly invoked, and/contact-sheetprovides one-click in-memory erasure (Erase Session Data). - Non-medical notice: AFTERIMAGE is an interactive digital art and narrative experiment for creative and informational purposes only; it is not a medical device and makes no diagnosis or treatment claims.
Agent Session
Built with Antigravity as my AI coding agent and pair programmer.
Sitting 1's 55% freeze and 100%-Center diagnosis through the additive gaze fix and Sitting 2 breakthrough:
