Case Study

How We Built Text Behind Subject, a Photo and Video Editor That Runs Entirely in the Browser

Client

Text Behind Subject

Timeline

Product development

Product

In-browser photo and video editor

Industry

Creator ToolsDesign SoftwareMedia Processing

Scope of Work

Product StrategyFront-End EngineeringOn-Device AIMedia Pipeline

Challenge

Putting text behind the subject of a photo means cutting the subject out first, and the tools that do it well send the image to a server. That rules the technique out for anything sensitive, adds an upload wait, and attaches a monthly fee to an effect that is really one composite. Text Behind Subject had to run segmentation, text compositing, video export, and object removal on the user's own machine, with no build step, no account, and no API key.

Solutions

Check Icon

Composited in three layers, background then text then the alpha-cut subject on top, so the whole effect is a draw order rather than a per-image mask edit.

Check Icon

Shipped six segmentation models and picked the default by measuring what the browser can actually do, returning BEN2 where WebGPU reports shader-f16 and BiRefNet lite 512 everywhere else.

Check Icon

Added a depth mode for scenes with no single subject, and a paint-by-hand path for images where neither model asks the right question.

Check Icon

Made geometry resolution-independent, with position as a fraction of the image and sizes as percentages of font size or image height, so the preview canvas and the 4K export run identical draw calls.

What the product delivers

Check Icon

No image or video leaves the user's machine, and there is no account, no upload queue, and no API key.

Check Icon

Export at full native resolution, up to 8192px for stills and 4K MP4 for video.

Check Icon

About 5,900 lines of vanilla ES modules across nineteen files, with no bundler and no install step.

Check Icon

Undo that counts a typed word as one entry and a slider drag as one entry, instead of eight and a hundred.

Text Behind Subject product interface