Gestures & WebcamPremium

Neon Face Scan

A neon mesh hugs the face, its 468-point double turns in the corner, and a hand gesture changes the colour — with a demo head when there is no camera.

WebcamMediaPipeFace trackingGesturesCanvas 2D

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Gestures & Webcam has 11 effects, all premium. Explore the category →

3 usage examples

Picking the colour of your neon portrait — photo booth at an electronic music festival — Neon Face Scan example 1

① Picking the colour of your neon portrait — photo booth at an electronic music festival

WhenWhile waiting their turn, the festival-goer sees the demo head and taps one of four swatches: the mesh changes tint. They start the camera, and their own face takes the colour, this time with a hand gesture.
WhyFour tints, four simple gestures: you set up your portrait without touching a screen a hundred people touched before you. The swatches stay for those who prefer to press.
Settings.nsc-kiosk variant with data-nsc-head="right": the demo head sits to the right of the text. The swatches are page buttons that call scene.nscBase.effect.setTheme('red', performance.now() / 1000) and read data-nsc-theme to light up. Taking the picture is not part of the purchased code.
“Frame your face” step — avatar creation for an online game — Neon Face Scan example 2

② “Frame your face” step — avatar creation for an online game

WhenSecond sign-up step: the player turns the camera on, places their face between the four corners and watches the mesh follow it while the scan band goes down. The double already shows them a head with depth.
WhyThe mesh and the framing corners say without a word whether the face is well placed; the scan suggests a capture in progress, which is what the player expects from this step.
Settings308 × 204 px frame, camera button shrunk and right-aligned, privacy sentence moved under the frame, .nsc-hud indicator removed from the HTML (the double moves up accordingly). In the capture, the head follows the mouse when it crosses the frame.
Neon head following the cursor next to the heading — website of a visual effects studio — Neon Face Scan example 3

③ Neon head following the cursor next to the heading — website of a visual effects studio

WhenThe visitor browses the top of the page: to the right of the heading, the head turns towards their cursor, the scan passes, the colour changes now and then. No camera is offered.
WhyA studio selling facial capture shows a face that reacts, without asking for any permission: this is demo mode used for its own sake.
SettingsSame .nsc-kiosk variant and data-nsc-head="right", but without .nsc-bar or .nsc-hud: the script accepts a scene with no button, and nothing is ever downloaded. A click outside a link moves to the next colour; links and buttons on your page do not change it.

How it works

On the face, the 2D canvas draws a mesh of 51 landmarks joined by 132 edges, brighter towards the front than on the sides. The outlines of eyes, eyebrows and lips are redrawn lighter, nine key points carry a glow, four corners frame the whole and a scan band travels from forehead to chin in 2.6 s.

At the top right, the same face is redrawn as a cloud of 468 points: the double, which slowly turns one way then the other, up to about 34°. It can dissolve: its points spread out as particles, then come back in about a second.

It is the only effect in the category that tracks two things at once: the face carries the drawing, the hand is the remote. One raised finger: cyan. Two fingers: red. Open hand: magenta. Index and thumb in an “L”: green. Fist: the double dissolves for as long as the fist is held. A gesture has to be seen three times in a row to count, and the tint cross-fades over 0.4 s, never abruptly. An indicator spells out the colour and the recognised gesture.

All of that happens on the webcam, which only the button turns on; two MediaPipe detectors (face, hand) then run inside the tab, and no picture leaves it. Before that click, the scene shows a generated head, MediaPipe's reference face model: it looks at the cursor, and the colour changes every 5.5 s or on click. The examples on this page use that head, not a real face.

Accessibility

  • Not informative content: canvas, video and indicator are aria-hidden. The scene states its purpose through aria-label, and camera messages (loading, “no face detected”, refusal) go through a role="status" pill.
  • Keyboard: the camera button is reached with Tab and answers Enter and Space. Changing colour on click has no key; to offer it from the keyboard, add buttons that call setTheme(), like the four swatches in the first example.
  • Reduced motion: no scan, still double, fixed colour, and the demo head only moves when the cursor does. A click still changes the tint, with a dissolve lasting a second and a half: a response to the visitor's action, not ongoing motion.
  • Touch: a tap moves to the next colour. Under 520 px in portrait, the scene switches to a 4/5 format, close to a selfie.
  • Face and privacy: the effect locates points; it recognises nobody, compares nothing and keeps nothing. Tell your visitors anyway: a camera aimed at a face worries people more than one aimed at hands.

Browser compatibility

2D canvas only for drawing; 51 KB of unminified JavaScript, including the demo's face model. Demo checked in all three test engines (Chromium 149, Firefox 151, WebKit 26.5): two scenes side by side each keep their own colour, not a single network request. Camera checked in Chromium and Firefox with a fake stream: five files downloaded on the first click, about 23 MB (the engine, a face model, a hand model), then MediaPipe's usage record every minute. On a test video the face and the “open hand” gesture were recognised; all five gestures were also checked by injecting hand landmarks. Safari: camera not verified.

Chrome 88+✓ Full (measured)
Firefox 89+✓ Full (measured)
Safari 15+✓ Demo measured · camera not verified
Edge 88+✓ Not verified
iOS Safari 15+✓ Not verified
Android Chrome 88+✓ Not verified

No webcam, permission refused or page not on https: the demo head stays on screen and a message says why. Face out of frame for 2.5 s: “No face detected”, and the mesh fades out. Detection too slow: the hand is only analysed every third or fourth frame, the face keeps priority. A scene that scrolls off screen shuts its camera and pauses detection; a new click starts it again.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0847-root">
  <div class="nsc-scene" data-nsc-lang="en" role="region" aria-label="Neon Face Scan — glowing mesh on your face and a holographic point-cloud double, colour driven by hand gestures. Cursor demo, camera on request (processed on your device only)">
    <video class="nsc-video" playsinline muted autoplay aria-hidden="true" tabindex="-1"></video>
    <canvas class="nsc-canvas" aria-hidden="true"></canvas>
    <div class="nsc-bar">
      <button class="nsc-btn nsc-cam-btn" type="button" aria-pressed="false">
        <span class="nsc-btn-ico" aria-hidden="true"></span><span class="nsc-btn-txt">Turn camera on</span>
      </button>
      <p class="nsc-privacy">No image ever leaves your device.</p>
    </div>
    <p class="nsc-status" role="status" aria-live="polite"></p>
    <div class="nsc-label" aria-hidden="true">
      <span>Neon Face Scan</span>
      <span class="nsc-hint">move the cursor · tap to change the colour · or turn the camera on</span>
    </div>
    <div class="nsc-hud" aria-hidden="true">
      <span class="nsc-hud-theme">Cyan</span>
      <span class="nsc-hud-hint">click or tap: next colour</span>
    </div>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Tints (JS — THEMES, THEME_ORDER) cyan, red, magenta, green Four RGB colours and the cycle order. The CSS variable --nsc-col, set on the scene, follows the current tint: use it to colour a heading or a button.
Gesture → tint (JS — GESTURE_THEME) one cyan, two red, open magenta, L green Change the mapping without touching recognition. The fist (fist) is not in this table: it drives the dissolve.
Demo cycle pace (JS — t + 5.5) 5.5 s Delay before the automatic colour change, without a camera. It appears in two places; a click resets it.
Scan (JS — (t / 2.6) % 1) one pass every 2.6 s Raise it to 4 for a calmer scan. The band covers 9% of the face height (fh * 0.09).
Demo head position (HTML — data-nsc-head) absent: centred head "right" shifts it to 72% of the width to leave room for text on the left; in portrait it moves above the text.
Indicator (HTML — .nsc-hud) present, top right Delete the block for a text-free scene: the double then sits 24 px from the top. The state stays readable in data-nsc-theme and data-nsc-gesture.
Processing load (JS — MAX_HANDS, HAND_EVERY) 1 hand, analysed every 2nd frame One hand is enough for gestures. Set HAND_EVERY to 3 on modest devices: gestures answer slightly later, the face stays smooth.
Face hold (JS — HOLD_FACE_MS) 420 ms How long the mesh stays on screen, fading, when the face is lost for a fraction of a second.

FAQ

No. The detector places points on a face, any face, without trying to work out whose it is. The code computes no fingerprint, compares nothing against a database and writes no file and no cookie. The MediaPipe library, for its part, sends Google a technical record every minute (version, processing times) with no image and no face point: list it in your privacy policy. Informing your visitors about how their camera is used remains your job.
Not with the delivered settings: one face (numFaces: 1) and one hand. If two people are in frame the detector picks one, and another person's hand can change the colour. For a booth, frame tightly.
It is MediaPipe's reference face model (468 vertices, Apache 2.0 licence), embedded in the script in compact form, so it is not downloaded. It depicts nobody. You can use it on its own, with no camera button, as in the third example.