How to Use the GEGL Graph Filter in GIMP

The GEGL Graph filter in GIMP enables advanced users to create non-destructive, node-based image processing pipelines using text-based composition. By leveraging GEGL (Generic Graphics Library)—GIMP’s core processing engine—you can construct custom filter trees, chain complex effects, and split or merge image data streams directly within a single operation window. This guide walks you through accessing the tool, understanding node syntax, and constructing linear and branching filter networks.

Accessing the GEGL Graph

To open the GEGL Graph interface in GIMP:

  1. Open your image or create a new layer.
  2. Navigate to the top menu and select Filters > Generic > GEGL Graph...
  3. A dialog window will appear with a text input area where you can write custom graph scripts. Ensure the Preview checkbox is enabled to see real-time updates on your canvas.

Understanding the Syntax

GEGL interprets commands sequentially from top to bottom by default. Each line represents a processing node or an operation parameter.

  • Operations: Specified by their GEGL operation name (e.g., gegl:gaussian-blur, gegl:opacity, gegl:over).
  • Properties: Assigned on the same line using key=value pairs.
  • Nodes and References: You can label nodes with id=name to store intermediate outputs, and recall them later using ref=name.
  • Compositing: Blend nodes like gegl:over take an auxiliary input (aux) to blend one node stream over another.

Building a Linear Filter Chain

A linear chain applies effects sequentially to the input image, passing the result of one operation into the next.

Enter the following script into the GEGL Graph dialog:

gegl:gaussian-blur std-dev-x=8 std-dev-y=8
gegl:color-temperature target-temperature=8000
gegl:vignette radius=1.2 softness=0.8

In this example:

  1. The image is blurred horizontally and vertically by 8 pixels.
  2. The color temperature of the blurred output is shifted warmer to 8000K.
  3. A vignette is applied to the final result.

Building a Branching Node Tree

To create complex effects, you can branch the image stream into separate paths and combine them using composition operations.

Example: Creating a Soft Glow Effect

The following graph duplicates the source stream, applies a blur and color boost to the duplicated branch, and blends it over the original sharp image using an addition blend mode:

# Step 1: Label the original input
id=original

# Step 2: Create the glow layer
gegl:gaussian-blur std-dev-x=20 std-dev-y=20
gegl:color-temperature target-temperature=9000
id=glow_layer

# Step 3: Blend the glow over the original
ref=original
gegl:add aux=[ ref=glow_layer ]

How the Branching Works:

  1. id=original assigns a reference name to the unprocessed source image.
  2. The blur and color shift run down the chain to form the glowing element, saved as id=glow_layer.
  3. ref=original resets the active stream back to the sharp source image.
  4. gegl:add combines the active stream with the auxiliary stream defined inside the square brackets (aux=[ ref=glow_layer ]).

Applying and Saving Graphs

  • Applying Changes: Click OK once you are satisfied with the preview. GIMP will render the entire tree onto the active layer.
  • Reusing Graphs: GEGL Graph configurations are plain text. Save your commonly used node trees in an external text file to copy and paste them into future projects whenever needed.