How GEGL Bloom Simulates Lens Glare in GIMP

The GEGL Bloom filter in GIMP simulates realistic lens glare and optical light bleed by extracting high-luminance pixels from an image, blurring them across a wider radius, and blending the resulting glow back over the original scene. In real-world photography, intense light scatters across lens elements and causes sensor blooming, producing a soft halo around bright objects. The GEGL Bloom operation mathematically replicates this physical phenomenon through thresholding, spatial convolution, and additive compositing.

1. Luminance Isolation (Thresholding)

The process begins by identifying the brightest parts of the image that should emit glare. The filter evaluates the luminance values of the pixels based on a user-defined threshold parameter.

  • Pixels with luminance values below the threshold remain unaffected and produce no light bleed.
  • Pixels meeting or exceeding the threshold are isolated into a temporary brightness map (or matte).
  • A "softness" or transition curve is often applied to this thresholding step to prevent harsh, pixelated edges between blooming and non-blooming regions.

2. Spatial Convolution (Blurring)

Once the high-intensity regions are isolated, the GEGL engine expands their footprint using a Gaussian blur algorithm. This step distributes the localized light energy into surrounding pixels, creating a smooth, outward radial falloff.

The blur radius determines the size of the halo, effectively simulating the degree of atmospheric scattering, lens quality imperfections, or internal reflections inside a camera barrel. By spreading the light outward, hard light sources—such as street lamps, neon lights, or the sun—are softened into glowing gradients.

3. Strength and Gain Adjustments

Before merging the glow with the base image, the filter scales the amplitude of the blurred light map using strength parameters. This step controls the perceived intensity of the light source, allowing users to make the glare faint and atmospheric or intensely blinding.

4. Additive Blending (Compositing)

The final step recombines the blurred, high-intensity layer back onto the original image using additive blending modes (similar to Screen or Linear Add/Addition).

Because the blending is additive:

  • Luminance values stack, naturally blowing out highlights toward pure white at the core of the light source.
  • The edges of the glow blend seamlessly into darker surrounding backgrounds.
  • The original details beneath the glow are partially preserved rather than simply replaced, creating a convincing optical bleed over adjacent objects.

Through this multi-step pipeline, GIMP’s GEGL engine mimics how optical systems handle dynamic range limitations, converting stark, digital highlights into convincing physical lens glare.