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.
Duplicate the Background Layer
Open your image in GIMP. In the Layers panel, right-click the base layer and select Duplicate Layer (or pressShift + Ctrl + D). Name this top layer "Blurred Layer."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.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.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).
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.
Select the Image Layer
Click on the image layer you want to modify.Open Focus Blur
Navigate to Filters > Blur > Focus Blur.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.
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.
Apply the Effect
Once the transition appears natural, click OK to render the blur.