How grigor-stoyanov/ascii-webcam works
ASCII Webcam is a browser-only webcam application that turns a live front-camera feed into colored ASCII art for display or capture. The main workflow acquires camera video, checks for motion, updates face landmarks and a person mask when needed, masks the frame, and renders a mirrored character grid with brightness and 3D face shading. Users can adjust presentation settings, save selfies, toggle FPS, and show camera status. Source excerpts establish the main control flow and several UI dependencies; README documents additional behavior. No server-side processing or persistent application store is indicated.
Main entry points: config.js Defaults and options · face.js Face landmarks · settings.js Live settings · ascii.js ASCII drawing
Components 18
Capture and detection
- MediaPipe runtime
src/detection/mediapipe.js - Motion check
src/detection/motion.js - Face landmarks
src/detection/face.js - Person segmentation
src/detection/segmentation.js
Masking and rendering
- Background mask
src/rendering/mask.js - ASCII drawing
src/rendering/ascii.js - Brightness and depth
src/rendering/brightness.js - Face overlay
src/rendering/faceOverlay.js
Controls and feedback
- Defaults and options
src/config.js - Live settings
src/settings.js - Settings panel
src/ui/panel.js - Keyboard controls
src/ui/keyboard.js - Selfie capture
src/ui/selfie.js - FPS counter
src/ui/fps.js - Camera status
src/ui/status.js
Other components
- Viewer
- Device camera
- Canvas output
Connections 34
- Viewer → Device camera: grants access
- Device camera → Motion check: supplies frames
- Motion check → Face landmarks: triggers detection
src/main.js - Motion check → Person segmentation: triggers segmentation
src/main.js - MediaPipe runtime → Face landmarks: provides runtime
src/detection/face.js - MediaPipe runtime → Person segmentation: provides runtime
src/detection/segmentation.js - Person segmentation → Background mask: returns mask
src/main.js - Background mask → ASCII drawing: masks frame
src/main.js - Face landmarks → ASCII drawing: supplies landmarks
src/main.js - ASCII drawing → Brightness and depth: computes levels
src/rendering/ascii.js - Face landmarks → Brightness and depth: supplies depth points
- ASCII drawing → Canvas output: draws characters
- Face landmarks → Face overlay: supplies landmarks
src/main.js - Face overlay → Canvas output: draws overlay
- Defaults and options → Motion check: sets thresholds
src/detection/motion.js - Defaults and options → Face landmarks: sets model options
src/detection/face.js - Defaults and options → Person segmentation: sets model options
src/detection/segmentation.js - Defaults and options → Brightness and depth: sets shading options
src/rendering/brightness.js - Defaults and options → ASCII drawing: sets render options
src/rendering/ascii.js - Defaults and options → Live settings: sets defaults
src/settings.js - Settings panel → Live settings: updates settings
src/ui/panel.js - Keyboard controls → Live settings: updates settings
src/ui/keyboard.js - Live settings → Settings panel: notifies changes
src/ui/panel.js - Live settings → ASCII drawing: configures rendering
src/rendering/ascii.js - Live settings → Brightness and depth: configures levels
src/rendering/brightness.js - Settings panel → Keyboard controls: reads shortcuts
src/ui/panel.js - Settings panel → Selfie capture: triggers capture
src/ui/panel.js - Keyboard controls → Selfie capture: triggers capture
src/ui/keyboard.js - Keyboard controls → FPS counter: toggles counter
src/ui/keyboard.js - Viewer → Settings panel: adjusts controls
README.md - Viewer → Keyboard controls: uses shortcuts
README.md - Viewer → Selfie capture: requests selfie
README.md - Viewer → FPS counter: toggles FPS
README.md - Camera status → Viewer: reports camera state