How to Lock Selection Borders in GIMP

This guide explains how to preserve and safeguard selection borders in GIMP during intensive painting and retouching workflows. While GIMP does not feature a single button labeled "Lock Selection," you can completely protect active selection boundaries from accidental clearing, replacement, or modification by saving them to locked channels or vector paths.

Method 1: Save the Selection to a Locked Channel

The most reliable way to secure a selection boundary in GIMP is by storing it as an independent channel and locking its pixels.

  1. Create your desired selection using any selection tool.
  2. Navigate to the top menu and select Select > Save to Channel.
  3. Open the Channels dialog (Windows > Dockable Dialogs > Channels if it is not visible).
  4. Locate the newly created channel, typically named Selection Mask copy.
  5. With this channel highlighted, click the Lock pixels icon (the padlock symbol) at the top of the Channels dock.
  6. Return to the Layers dialog and continue painting.

If you accidentally click outside the canvas with a selection tool or press a shortcut that drops the boundary, you can restore it instantly: open the Channels dialog, right-click your saved channel, and click Channel to Selection.

Method 2: Convert the Selection into a Vector Path

Converting your boundary to a path isolates the shape from the raster canvas entirely, ensuring raster painting operations cannot alter the border geometry.

  1. Generate your active selection.
  2. Go to Select > To Path.
  3. Open the Paths dialog (Windows > Dockable Dialogs > Paths).
  4. Double-click the path to give it a recognizable name.
  5. Click the Lock position and size or Lock path icon at the top of the panel to prevent accidental node adjustments.
  6. Whenever you need to reactivate the exact boundary, highlight the path in the Paths dialog and click the Path to Selection icon (the red square with marching ants) at the bottom of the panel, or press Shift + V.

Best Practices to Prevent Accidental Edits

  • Switch Tools Immediately: After finalizing a boundary, immediately select your painting tool (such as the Paintbrush, shortcut P) instead of leaving a selection tool active. Stray clicks with brush tools will only paint within the active area rather than clearing the selection.
  • Hide the Marching Ants: Press Ctrl + T (or go to View > Show Selection) to hide the animated dotted line. The boundary remains fully active and constrains your brush strokes, but hiding the visual outline prevents you from accidentally attempting to interact with the selection edges directly.