GIMP Selection to Path Polygon Fitting Guide

Converting a raster selection into a vector path in GIMP relies on an algorithmic trace that translates pixel edges into scalable Bézier splines. The advanced polygon fitting parameters control this conversion by defining how tightly, smoothly, and accurately the generated path conforms to the original selection boundary. Understanding these settings allows you to balance path fidelity against node complexity, preventing overly dense paths while maintaining sharp details.

How Polygon Fitting Works in GIMP

When GIMP converts a selection to a path, it does not immediately generate smooth curves. Instead, it executes an intermediate step: tracing the pixel boundary to create a rough multi-sided polygon. Once this polygon is established, GIMP simplifies it and fits Bézier curves over the straight edges.

The advanced polygon fitting settings govern this intermediate phase. If the polygon fits the selection poorly, the final vector path will either smooth over critical details or introduce jagged artifacts from pixel noise.

Key Advanced Parameters and Their Functions

  • Corner Threshold: Defines the angle (in degrees) that qualifies as a sharp corner. If an angle in the intermediate polygon is smaller than this threshold, GIMP preserves it as an acute, non-smoothed corner node. Higher values smooth out more corners, while lower values preserve sharp, angular transitions.
  • Error Threshold: Specifies the maximum distance (in pixels) the intermediate polygon is allowed to deviate from the original selection boundary. A lower error threshold forces the path to follow the selection outline rigorously, resulting in higher fidelity but significantly more anchor points. A higher threshold allows looser approximations, creating cleaner, lower-node paths.
  • Subdivide Search and Subdivide Threshold: These parameters determine how aggressively the algorithm splits polygon edges to better match complex selection boundaries. When the deviation exceeds the threshold, the algorithm subdivides the line into smaller segments. Adjusting these values helps capture intricate concavities and small cutouts without uniformly increasing the node count across the entire path.
  • Line Threshold: Dictates the maximum acceptable deviation for a sequence of points to be treated as a single straight line rather than a curve. Increasing the line threshold forces near-straight curves to snap into flat polygon segments, which is ideal for mechanical, geometric, or architectural shapes.
  • Filter Alternative Surround: Determines the adjacent pixel radius examined to eliminate isolated pixels and staircase noise inherent to raster masks. A higher value prevents the polygon from tracing individual pixel steps, generating a smoother baseline shape prior to final spline calculation.
  • Tangent Surround: Controls how many adjacent points along the polygon are considered when computing the direction and handle lengths of the final Bézier curve tangents. Increasing this value produces sweeping, broad curves, while decreasing it allows curves to turn tightly along sharp contours.

Practical Application

To vectorize clean, organic shapes with minimal anchor points, set a higher Error Threshold and enable a moderate Filter Alternative Surround. For hard-edged, geometric, or typographic selections, reduce the Error Threshold, lower the Corner Threshold, and increase the Line Threshold to ensure straight edges remain planar and sharp corners do not become rounded.