Create Depth of Field Using Gradient Blur in GIMP

Simulating a realistic depth of field in GIMP allows you to draw focus to a specific subject by progressively blurring the background and foreground. This article outlines the step-by-step process of using gradient-driven blur effects—utilizing either a layer mask with a gradient fill over a blurred duplicate layer or the integrated GEGL Focus Blur filter—to achieve a natural, camera-like lens blur across any digital photograph.

Method 1: The Layer Mask and Gradient Technique

This method provides the most control, allowing you to selectively protect your subject while transitioning the blur smoothly into the distance.

  1. Duplicate the Background Layer
    Open your image in GIMP. In the Layers panel, right-click the base layer and select Duplicate Layer (or press Shift + Ctrl + D). Name this top layer "Blurred Layer."

  2. Apply the Blur Filter
    Select the "Blurred Layer," navigate to Filters > Blur > Gaussian Blur (or Lens Blur if available). Increase the Size X and Size Y parameters to achieve the maximum amount of out-of-focus blur you want for the furthest elements of your background, then click OK.

  3. Add a Layer Mask
    Right-click the "Blurred Layer" in the Layers panel and select Add Layer Mask. Choose White (full opacity) and click Add.

  4. Apply a Gradient to the Mask
    Select the Gradient Tool (G) from the toolbox. In the Tool Options:

    • Set the gradient to FG to BG (RGB) (Black to White).
    • Set the shape to Linear (for a flat depth plane) or Radial (for vignettes/spotlight focus).
    • Click on the layer mask thumbnail to ensure it is active.
    • Click and drag from your main subject (black, where blur will be hidden) toward the background (white, where blur will be fully visible).
  5. Refine Subject Edges
    If your subject extends into the blurred area, select the Paintbrush Tool (P), set your foreground color to black, and paint directly on the layer mask over the subject to remove unwanted blur from sharp edges.


Method 2: The GEGL Focus Blur Tool

For a faster, interactive workflow, modern versions of GIMP include a dedicated Focus Blur tool that uses an integrated on-canvas gradient.

  1. Select the Image Layer
    Click on the image layer you want to modify.

  2. Open Focus Blur
    Navigate to Filters > Blur > Focus Blur.

  3. Adjust the On-Canvas Handles
    On your image canvas, interactive control handles will appear:

    • Center Point: Drag the center point to position the primary focal plane on your subject.
    • Inner Ring/Line: Defines the boundary of the sharp area. Everything inside remains completely in focus.
    • Outer Ring/Line: Controls the gradient transition where the blur reaches maximum strength.
  4. Configure Filter Parameters
    In the Focus Blur dialog:

    • Adjust Blur Radius to set how soft the background becomes.
    • Set the Shape to Linear (for horizon/landscape depth) or Radial (for portraits and close-ups).
    • Adjust Midpoint and Fade Out sliders to control the falloff rate of the gradient.
  5. Apply the Effect
    Once the transition appears natural, click OK to render the blur.