GIMP Oil Painting with Symmetric Nearest Neighbor

The GEGL Symmetric Nearest Neighbor (SNN) filter in GIMP serves as a critical edge-preserving smoothing tool used to convert digital photographs into painterly, oil-style artwork. By selectively blurring flat areas while maintaining crisp boundary lines, the filter simplifies complex textures, clusters color tones, and mimics the broad, deliberate strokes characteristic of traditional oil paints.

How the Symmetric Nearest Neighbor Filter Works

The Symmetric Nearest Neighbor filter operates by analyzing pixels within a designated radius around a central target pixel. Instead of averaging all neighboring pixels equally—as a standard blur filter does—the SNN filter inspects pairs of opposite pixels equidistant from the center. For each pair, it selects the pixel that is closest in color and brightness to the central pixel. It then computes the average of only these selected pixels to generate the final color value.

Edge Preservation Without Loss of Form

In oil painting, an artist uses distinct brushstrokes that define objects with sharp contours, even when the colors within those objects are blended smoothly. Standard blur filters, such as Gaussian Blur, degrade these edges and make the image look unfocused or hazy. The SNN filter prevents this issue. Because it rejects pixel values that differ substantially across an edge boundary, it retains high-contrast lines and transitions. This allows subjects, horizons, and object outlines to remain recognizable and defined.

Color Simplification and Pigment Clustering

Photographs contain fine gradations of color, digital noise, and micro-details such as skin pores, foliage texture, or fabric weave. Oil paintings, by contrast, rely on cohesive patches of mixed pigment. The SNN filter eliminates hyper-realistic surface details by flattening subtle gradients into unified color fields. This grouping of adjacent shades creates the visual impression of paint applied with a flat brush or palette knife.

Role in the Digital Oil Painting Workflow

While the SNN filter can create an immediate painterly effect on its own, its primary purpose in complex workflows is to serve as the base layer for subsequent artistic treatments. By establishing clean color masses and sharp boundaries, the filter prepares the image for:

  • Bump Mapping and Embossing: Applying canvas textures or simulated paint thickness (impasto) works far better on simplified color fields than on noisy photographic data.
  • Color Grading and Saturation: Painterly styles often require heightened saturation or localized contrast adjustments, which look more natural over flattened color regions.
  • Layer Blending: Stacking multiple iterations of the SNN filter at varying radii allows artists to produce broad background strokes alongside finer foreground details.