Open your phone’s camera, switch to Portrait Mode, and photograph a friend. The result looks like it came from a professional: a razor-sharp face floating in front of a creamy, dreamy blur. That soft background is called bokeh, and on a dedicated camera it comes from a fast, expensive lens. But your phone’s lens is tiny, and it never actually threw the background out of focus. The blur you see was painted on by software, pixel by pixel, in the fraction of a second after you pressed the shutter. Here’s how Portrait Mode fakes it.

What real bokeh is — and why your phone can’t do it
Bokeh is the aesthetic quality of a photo’s out-of-focus areas. Optically, it comes from shallow depth of field, which is governed by three things: aperture, focal length, and subject distance. Open a full-frame camera to f/1.4 on an 85mm lens and only a thin slice of the scene stays sharp; everything else dissolves into soft, circular highlights shaped by the aperture blades.
Phone cameras can’t produce this, and it’s a matter of physics, not software. A phone sensor is about the size of a fingernail, with a correspondingly short focal length. At matched framing, that combination yields an enormous depth of field — nearly everything in the scene is sharp at once, even wide open. Matching the blur of an 85mm f/1.4 lens would require optics that simply cannot fit in a slim device. So manufacturers reached for the only tool left: computation.
The pipeline: three steps to a fake blur
Portrait Mode is not one effect but a pipeline of three stages that runs in roughly a second.
Step 1 — Depth estimation
Before it can blur anything, the phone must know how far every pixel sits from the camera. The output is a depth map: a grayscale image in which brightness encodes distance. Phones build this map in several ways, often combining them.
- Dual-camera stereo parallax. Apple’s iPhone 7 Plus (2016) popularized this. Two lenses a short distance apart see slightly different views, and the displacement of a feature between them reveals its distance — the same trick human binocular vision uses.
- Dual-pixel autofocus. Google’s Pixel 2 (2017) proved you don’t need two cameras. A dual-pixel sensor splits every photosite into two half-photodiodes that see two halves of the lens, yielding a stereo pair from a single lens.
- LiDAR and time-of-flight. iPhone Pro models since the 12 add a LiDAR scanner that fires infrared pulses and measures return time for a direct distance readout.
- Neural-network depth. Modern phones also run a trained network that infers plausible depth from a single image, recognizing familiar scene structures even with no parallax at all.
Step 2 — Subject segmentation
A depth map isn’t enough; the phone also has to decide which pixels are the person and which are the background. A machine-learning model trained on millions of portraits traces a mask around the subject. This is the hardest stage and where Portrait Mode most often fails — around flyaway hair, eyeglass frames, and translucent fabrics like veils or mesh.
Step 3 — Blur application
With a depth map and a subject mask in hand, the phone applies blur to everything outside the mask, scaled by estimated distance: pixels just behind the subject get a light blur, distant pixels a heavy one. Good implementations also synthesize aperture-shaped highlights — the round “bokeh balls” — to mimic a real lens. The aperture slider you see after capture simply re-runs this stage with a different virtual f-number, something no optical lens can do in reverse.

Where the illusion breaks
Because every stage is an estimate, artifacts give the game away. Depth confidence falls off with distance, so far backgrounds can band or blur unevenly. Hair strands and translucent edges bleed into the background, and a simple Gaussian blur lacks the uniform core and aperture-shaped edge of true optical defocus — which is why phone bokeh can look “smooth but somehow off” next to a fast prime lens.
Tips for better-looking fake bokeh
- Pull your subject several feet away from the background so the depth map has an easy decision to make.
- Shoot in even, bright light — segmentation gets noticeably worse in the dark.
- Prefer the telephoto lens if your phone offers one; its narrower view gives cleaner subject separation.
- Avoid complex edges such as flyaway hair, mesh, or busy patterned clothing when you can.
Conclusion
Portrait Mode is one of the cleverest illusions in photography: a depth estimator, a subject matte, and a synthetic blur engine working together to imitate a lens your phone will never have. It isn’t real optics, and at the edges it still confesses. But for the picture that matters, the fake is usually good enough — and that is exactly the point.
FAQ
Is Portrait Mode bokeh real?
No. The background is sharp in the original capture; the blur is generated afterward by software using an estimated depth map, not by the optics.
Why does it blur parts of my hair or glasses?
Segmentation traces a mask around the subject, and fine or translucent edges are the hardest thing for the model to classify correctly.
Can I change the blur after taking the shot?
Yes. The aperture/depth slider re-applies the synthetic blur at a different intensity — an option optical cameras don’t have.