Finger Frame Filter
Make a frame with the thumb and index finger of each hand: whatever it holds turns thermal, pop art, X-ray, neon or night vision. Without a camera, the frame follows the cursor over a photo.
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



How it works
The other effects in this family draw on top of the picture. This one transforms the picture itself, and only in one area: the quadrilateral whose four corners are the tips of the thumb and index finger of each hand. Inside, every pixel goes through a WebGL shader; outside, nothing changes. A light outline and four small rings mark the frame.
Five filters follow one another. Thermal turns brightness into five colours, from night blue to warm white. Pop art reduces the picture to four flat tones. X-ray is a bluish negative. Neon keeps only the outlines, in magenta on black. Night brightens everything in green with a light grain. These are graphic looks: the thermal filter reads light, not heat.
To change filter, close the frame by bringing thumbs and index fingers together until only a flat band is left, hold for 0.12 s, then open it again: the next filter fades in over 0.6 s. A click or a tap on the scene does the same, and so does the "Filter" button, which shows the name of the current filter. With a single hand, the L of the thumb and index finger gives a parallelogram.
While the camera is off, the effect works on a photo of a street at night, built into the script: the frame follows the cursor, and two drawn hands close it every 6 s. The captures on this page show this mode, with the code you buy. Once the camera is turned on from its button, the photo gives way to your mirrored picture, analysed in the browser by MediaPipe. That picture never leaves the device. MediaPipe does, however, report its usage to Google: a request of a few dozen bytes to odml.pa.googleapis.com one minute after it loads, then one per minute while the camera is filming, with counters and durations and not a single pixel. Worth citing in the privacy policy of the site that embeds the effect.
Accessibility
- Keyboard: two tab stops, the camera button then the "Filter" button, which moves to the next filter on Enter or Space. Its accessible name repeats its visible text ("Filter: Thermal — change filter") and the button is an
aria-liveregion: its new text is announced. - Reduced motion: the drawn hands no longer close the frame by themselves and the grain of the night filter is frozen: at rest, the filtered picture no longer changes. A click still changes filter, with the same fade.
- Meaning of the filters: each has an accent colour, used by the outline and the dot on the button, but the name is always written out: colour alone carries no information.
- Touch: a tap without dragging changes filter. The frame follows a sideways slide of the finger, while a vertical slide scrolls the page as usual. Change on tap verified in all three engines, on an emulated touch screen.
- Light: no hard cut, everything goes through a fade, and the gesture can change filter only once every 0.8 s. The pop art and neon filters give highly saturated colours over a large area when the frame is big.
Browser compatibility
WebGL 1 for the filter, Canvas 2D for the markers. The JavaScript weighs 223 KB unminified, 173 KB of which is the demo photo (a 130 KB WebP encoded in base64): in demo, no network request. Pasted twice into a page, the code gives two independent frames: in Chromium 149, Firefox 151 and WebKit 26.5, clicking the second changes only its filter. Camera mode was run in Chromium and Firefox on a simulated webcam: the detector is a 10.7 MB download, then MediaPipe sends its log to Google once a minute. The gesture was verified in Chromium by simulating the hand landmarks: frame closed then reopened, one filter further; frame kept closed for 4 s, a single change on reopening. A trial video also triggered a change. Safari: camera mode not checked.
Without WebGL, the frame is cut out in Canvas 2D and the five looks are approximated with canvas CSS filters (ctx.filter); this fallback was not measured, and Safari only knows ctx.filter from version 18. WebGL context lost: the rendering is rebuilt as soon as the browser gives it back. Camera refused: the demo photo stays in place.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0851-root">
<div class="cfl-scene" data-cfl-lang="en" role="region" aria-label="Filter Frame — the frame you shape with your fingers filters the picture: thermal, pop art, X-ray, neon, night vision. Cursor demo, camera on request (processed on your device only)">
<video class="cfl-video" playsinline muted autoplay aria-hidden="true" tabindex="-1"></video>
<canvas class="cfl-canvas" aria-hidden="true"></canvas>
<div class="cfl-bar">
<button class="cfl-btn cfl-cam-btn" type="button" aria-pressed="false">
<span class="cfl-btn-ico" aria-hidden="true"></span><span class="cfl-btn-txt">Turn camera on</span>
</button>
<button class="cfl-btn cfl-filter-btn" type="button" aria-live="polite">
<span class="cfl-btn-ico" aria-hidden="true"></span><span class="cfl-btn-pre">Filter:</span><span class="cfl-btn-txt">Thermal</span>
</button>
<p class="cfl-privacy">No image ever leaves your device.</p>
</div>
<p class="cfl-status" role="status" aria-live="polite"></p>
<canvas class="cfl-gl" aria-hidden="true"></canvas>
<div class="cfl-label" aria-hidden="true">
<span>Filter Frame</span>
<span class="cfl-hint">move the cursor · click to change filter</span>
</div>
</div>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
Your own demo photo (JS — DEMO_IMAGE) |
night street, 1120 × 700 px | An image from your own domain or a data URI, cropped like the video to fill the scene. For an image from another domain, you also need to set crossOrigin on the image in the script and have its server allow it, otherwise WebGL rejects it. |
Fade length (JS — FADE_S) |
0.6 s | Time to go from one filter to the next. Do not go below 0.35 s: a hard change of large saturated areas bothers photosensitive people. |
Gesture thresholds (JS — CLOSE_T, OPEN_T) |
0.06 and 0.16 | Area of the frame divided by the square of its longest diagonal: below the first threshold the frame is "closed", above the second it is "reopened". Bring them closer if the gesture feels too wide. |
Hold time and delay (JS — ARM_S, COOL_S) |
0.12 s and 0.8 s | How long the frame must stay closed, then the minimum delay between two gesture-triggered changes. |
Demo pace (JS — DEMO_CYCLE) |
6 s | Interval between two automatic pinches of the drawn hands. The pinch timings are written in squeezeCurve. |
Accent colours (JS — FILTERS) |
orange, magenta, ice blue, bright magenta, green | Colour of the outline and of the button dot for each filter. The colours of the looks themselves are in the FS shader, one function per filter. |
Filter names (JS — FX_TEXT.filters) |
Thermal, Pop art, X-ray, Neon, Night | Button texts; the French defaults sit in FX_TEXT, the English ones in FX_TEXT_EN. |
Hero variant (HTML — .cfl-kiosk, data-cfl-start) |
to add to the HTML | Already styled in the shipped CSS: a dark veil covers the left of the photo, holding a headline, a paragraph and a button that turns the camera on. |
FAQ
render, the quad variable receives four points in scene pixels; give it the four corners of the scene and the whole picture is filtered.scene.cflBase.effect.fb, a rank from 0 to 4 in the order thermal, pop art, X-ray, neon, night. effect.next() moves to the next one. There is no event and no method to pick a given filter: read the rank again every 100 ms or so and call next() until you reach the one you want, as in the first example.