DEV Community

Voor AI
Voor AI

Posted on

How to Add Depth of Field to a Photo With an Edge-Safe Focus Map

A real Voor Depth Of Field result

Adding synthetic depth of field is a segmentation problem before it is a blur problem. Define what must stay sharp, add a protected edge band around it, and reject any result that blurs across the subject boundary.

Before and after from the stored Voor Depth Of Field example

This comparison uses the app's stored first-party input and result. No new generation was submitted for this tutorial.

Model the focus map

Use the visible skateboarder as the foreground subject and split the image into three regions:

type Region = "sharp" | "transition" | "blur";

interface FocusMap {
  subject: string[];
  protectedEdges: string[];
  background: string[];
  blurIntent: "ultra-shallow" | "shallow" | "moderate";
}

const map: FocusMap = {
  subject: ["face", "hair", "shirt", "shorts", "arms", "legs", "skateboard"],
  protectedEdges: ["hair silhouette", "fingers", "shirt", "legs", "board edge"],
  background: ["sky", "tree line", "road", "distant grass"],
  blurIntent: "ultra-shallow"
};
Enter fullscreen mode Exit fullscreen mode

The transition region matters most. A uniform blur mask will either leave the background too sharp or cut into hair and fingers.

Use the direct Depth Of Field app

Open the current Depth Of Field workspace. The live page describes FLUX.1 Kontext [pro], requires an Input Image, currently defaults Blur Effect to ultra shallow depth of field, offers Match Input Image and PNG, exposes Seed under Advanced Settings, and shows Public plus Generate.

Use a source with a clear foreground subject and enough background distance to make the requested optics plausible. Keep Match Input Image so edge comparisons remain aligned.

Translate the map into a narrow instruction

Avoid merely saying “cinematic bokeh.” Name the plane, protected boundary and background behavior:

Keep the skateboarder, face, hair, shirt, arms, legs and board completely sharp. Add ultra-shallow depth of field only behind the outer body and skateboard edges. Use a soft graduated transition; blur the sky, tree line, road and distant grass into natural optical bokeh. Preserve pose, crop, lighting and foreground edges. No halo, cutout edge or radial blur.

If the app's Blur Effect control already expresses the strength, use the prompt to describe placement and exclusions rather than repeating decorative adjectives.

Run an edge validator

Review at 200% zoom. Sample pixels on both sides of difficult boundaries:

interface EdgeSample {
  name: string;
  subjectDetailRetained: boolean;
  backgroundSoftened: boolean;
  haloVisible: boolean;
}

const validEdge = (e: EdgeSample) =>
  e.subjectDetailRetained && e.backgroundSoftened && !e.haloVisible;
Enter fullscreen mode Exit fullscreen mode

Test flyaway hair, glasses, fingers, translucent fabric and reflective edges. Then zoom back to 100% and check whether the blur direction and intensity feel like one lens rather than a painted mask.

Separate optical errors from content errors

  • Halo: widen the transition band and ask for gradual optical falloff.
  • Blurred hair: name the full hair silhouette as sharp.
  • Sharp holes in the background: enumerate visible background objects.
  • Radial smear: request lens-like bokeh, not motion blur.
  • Changed face or clothes: reduce the change set to background defocus only.

Execution constraints

The live credit estimate can depend on account state and completed inputs. Inspect it immediately before Generate rather than hard-coding a number. Keep Public only if the uploaded image may be publicly visible. Use photos you own or are authorized to edit.

Physical limitations

An AI blur is not a recovered depth map or a substitute for optical capture. Fine transparent edges, reflections and overlapping objects may be inferred incorrectly. Keep the original and disclose synthetic editing when documentary context matters.

Once every protected boundary is listed, run the edit in the exact Voor depth-of-field app and make the edge validator—not aesthetic excitement—the release gate.

Top comments (0)