# Portrait Blur

> Blur the background of a photo in your browser: AI depth, tap to refocus, f/1.4 to f/8 lens blur, round or hexagon bokeh. Free; the photo is never uploaded.

- URL: https://bytescope.dev/en/portrait-blur/
- Locale: en · Also: [ja](https://bytescope.dev/ja/portrait-blur.md) · [zh-Hant](https://bytescope.dev/zh-Hant/portrait-blur.md)
- Runs: Your files never leave your browser — all processing is local.
- Requires: Any modern browser. Uses WebGPU where the browser has it (Chrome, Edge, Safari 26, recent Firefox) and falls back to WebAssembly on the CPU, which is several times slower on large images.
- Updated: 2026-09-08

## What it does

Phones fake a shallow depth of field with a depth sensor or a second camera. A photo from a camera, an older phone or a scan has no depth data, so this page estimates it: Depth Anything V2 Small (Apache-2.0) guesses how far away every part of the picture is, MODNet finds the person, and the blur grows with the distance from the plane you focus on. Add bokeh to a photo, blur a busy background behind a portrait, product or pet — all in this tab, without handing the picture to anyone.

### Focus, aperture and bokeh

Focus starts on the detected subject. Tap anywhere on the result to focus on that depth instead; only the blur is recomputed, the models do not run again. Blur strength is labelled f/1.4 to f/8 because that is how photographers think about it, but the number is a metaphor, not a lens setting. The bokeh can be round or hexagonal, and bright points turn into bright discs because the blur is computed in linear light. Swipe between the original and the result, or open the depth map to see what the model thought was near and far.

### Honest limits

Depth is guessed by AI from one photo, not measured. Edges of hair, glass, mirrors and thin railings often go wrong. Subject protection keeps the person sharp even where the depth map got the hair wrong; it helps a lot, but it is not right every time, and it is tuned for people, so pets and products rely on the depth map alone. The shape and size of the bokeh are simulated, not what a real lens would draw. Without WebGPU the page switches to a slower, coarser method and shows which one is running.

### What it downloads and what it keeps

The first photo downloads about 125 MB of models from Hugging Face — 99 MB for depth and 26 MB for the subject — and they stay in this browser's cache afterwards. The photo itself is never uploaded; there is no upload endpoint. The result is saved at the photo's own size, up to 8,192 px on the long edge and 16 million pixels, as a JPEG (quality 0.92) or a PNG.

## Limits

Does not measure depth — an AI model guesses it from one photo, so hair, glass, mirrors and thin railings can come out wrong. It does not read or fix the depth data a phone saved with a portrait shot, does not blur video, and does not upload photos.

## FAQ

### Is my photo uploaded?

No. The photo is decoded, analysed, blurred and encoded in this tab, and the site has no upload endpoint. The only network requests are the two model files, and your photo is not part of them. Watch the Network tab in DevTools if you would rather check than trust.

### Why does the first photo download about 125 MB?

Two models run in your browser. The depth model, Depth Anything V2 Small, is 99 MB: we use the full-precision file because the smaller 27 MB version was slower in browsers and less accurate. MODNet, 26 MB, finds the person; it is the same file Remove Background and ID Photo Maker use. Both are downloaded once and stay in this browser's cache, so the next photo starts right away.

### Why are hair or glass edges sometimes wrong, and what does subject protection do?

The depth is guessed by AI from a single photo at a much lower resolution than the photo, then fitted back to its edges. Fine hair, glass, mirrors and thin railings are where that guess often goes wrong, so background can stay sharp or the edge of a person can blur. Subject protection uses a second model that finds people: everything it marks as the person stays sharp, whatever the depth map says. It fixes most hair edges, but not every time. If the subject model finds no person, protection is switched off and the page says why.

### Does f/1.4 mean the same as on a real lens?

No. The f-number is a metaphor for blur strength: f/1.4 is the strongest blur, f/8 the mildest. There is no real focal length, sensor size or distance behind it, and the bokeh shape and size are simulated rather than what a particular lens would draw.

### Why is it slower on my computer?

With WebGPU, the depth model and the heaviest step of the blur run on the graphics card. Without it, everything runs on the CPU through WebAssembly: the depth model gets a smaller input to stay usable, and the blur is computed on a coarser grid. The page says which path is running. It still works, it just takes longer and the blur is a little rougher.

### Can I use it on pets or products?

Yes. The blur follows the depth map, which works for anything with a clear foreground and background. Subject protection is tuned for people, though, so on a pet or a product it may find nothing and switch itself off, or protect only part of the subject. Tap the subject to set the focus on it.

### What size is the downloaded photo?

The same size as your photo, up to 8,192 px on the long edge and 16 million pixels in total. A larger photo is scaled down to fit, and the page shows the output size before you download. JPEG is saved at quality 0.92 with any transparency filled white; PNG keeps transparency.

## Related tools

- [Remove Background](https://bytescope.dev/en/remove-background.md) — Cut the subject out instead, as a transparent PNG.
- [ID Photo Maker](https://bytescope.dev/en/id-photo.md) — Turn a portrait into a passport or visa photo with verified sizes.
- [AI Image Upscaler](https://bytescope.dev/en/upscale-image.md) — Make a small photo 2× or 4× bigger with AI before you blur it.
