---
title: "Building Background Effects for Clips"
description: "Slack's Clips background blur and image replacement run as a browser and desktop pipeline."
url: "https://swe.quest/articles/building-background-effects-for-clips-cb745a4b3f0b9f4c"
canonical: "https://slack.engineering/building-background-effects-for-clips/"
source: "Slack Engineering"
published: "2022-06-07"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 6
tags: ["computer-vision","video-media","webassembly","browsers","performance"]
---

# Building Background Effects for Clips

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2022-06-07, 6 min read, Deep dive. Original: [https://slack.engineering/building-background-effects-for-clips/](https://slack.engineering/building-background-effects-for-clips/)

## Summary

Slack's Clips background blur and image replacement run as a browser and desktop pipeline. Webcam frames are read via the Insertable Streams API on a worker thread, downscaled to 256x144, and segmented by MediaPipe's landscape selfie model compiled to WebAssembly. All compositing happens in WebGL shaders. The mask is upsampled and bilateral-filtered to smooth edges. Blur uses a mask-weighted Gaussian that also weights each sample by the mask to prevent haloing. Replacement blurs the mask most where confidence is near 0.5, thresholds it into a crisp edge, blurs the background, then alpha-blends. Edge-detection fusion was prototyped but was too unreliable on noisy or low-contrast regions to ship.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [Video & media](https://swe.quest/tags/video-media.md) (Domains)
- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- WebGL shaders
- image filtering basics
- browser media APIs ([easy posts on Video & media](https://swe.quest/tags/video-media.md?difficulty=easy))

## Keywords

Slack Clips, MediaPipe, WebGL, WebAssembly, Insertable Streams API, TensorFlow Lite, bilateral filter, body-pix

## Related posts

- [Build awesome datasets for video generation](https://swe.quest/articles/build-awesome-datasets-for-video-generation-234cead646e03175.md): Hugging Face · 2025-02-12 · Medium · 5 min read · Model training, Computer vision, Data pipelines, Video & media
  A three-stage pipeline for building small video-generation fine-tuning datasets: acquisition with yt-dlp and scene splitting, per-frame filtering for watermarks, aesthetics and NSFW content plus an OpenCV motion score, and captioning with Florence-2 or a video captioner like Qwen2VL.
- [Building an AI WebTV](https://swe.quest/articles/building-an-ai-webtv-7dad8a539728d692.md): Hugging Face · 2023-07-17 · Medium · 9 min read · Video & media, Inference & serving, TypeScript, Machine learning
  The AI WebTV is an experimental 24/7 stream of short clips generated by open-source text-to-video and music models.
- [Video Invisible Watermarking at Scale](https://swe.quest/articles/video-invisible-watermarking-at-scale-acb75c9e33b19572.md): Meta Engineering · 2025-11-04 · Medium · 8 min read · Video & media, Inference & serving, Performance engineering, Cost optimization, Privacy
  Meta runs ML-based invisible video watermarking (VideoSeal-style) as a custom FFmpeg filter for provenance use cases like detecting AI-generated video and identifying first uploaders.
- [Multi‑Ratio Video Resizing for Mobile Feed and Marketing](https://swe.quest/articles/multi-ratio-video-resizing-for-mobile-feed-and-marketing-5ad890c1fea2e907.md): Netflix TechBlog · 2026-10-26 · Easy · 4 min read · Video & media, Computer vision
  Netflix automatically reframes 16:9 footage into 9:16, 4:5 and 1:1 crops with a "virtual camera" pipeline built in three stages.
- [Zero-shot image-to-text generation with BLIP-2](https://swe.quest/articles/zero-shot-image-to-text-generation-with-blip-2-6253370fee81620e.md): Hugging Face · 2023-02-15 · Medium · 7 min read · Computer vision, LLMs, Machine learning, Python
  BLIP-2 connects a frozen pre-trained image encoder (ViT) to a frozen LLM (OPT or Flan-T5) through a lightweight Querying Transformer (Q-Former), the only trainable component.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
