Clip a Raster Layer with a Path in GIMP

Clipping a raster layer with a vector path in GIMP allows you to hide unwanted areas of an image without permanently deleting pixels. This guide explains how to use GIMP's layer mask system to apply a vector path as a precise, non-destructive clipping boundary for any raster layer.

Method 1: Add a Layer Mask Directly from a Path

The fastest and most flexible way to clip a raster layer using a vector path is by initializing a layer mask directly from the Paths panel.

  1. Draw or Select Your Path: Use the Paths Tool (shortcut: B) to draw your vector shape around the area you want to keep. Ensure the path is closed if you want a complete shape.
  2. Select the Target Layer: In the Layers panel, click on the raster layer you want to clip.
  3. Open the Mask Dialog: Right-click the selected layer and choose Add Layer Mask... (or go to Layer > Mask > Add Layer Mask... in the top menu).
  4. Choose Path as the Mask Source: In the dialog window that appears, select the Path option under the "Initialize Layer Mask to:" section.
  5. Select Your Path: Use the dropdown menu next to the Path option to choose the vector path you created.
  6. Apply the Mask: Check the Invert mask box if you want to hide the area inside the path instead of outside. Click Add.

The raster layer is now clipped to the exact contour of your vector path.

Method 2: Convert Path to Selection and Mask

If you are using an older version of GIMP or prefer working through selections, you can convert the vector path to a raster selection first.

  1. Select the Path: Open the Paths tab (found alongside the Layers and Channels tabs). Right-click your path and select Path to Selection (or click the red square icon at the bottom of the panel).
  2. Return to Layers: Click the Layers tab and select the raster layer you wish to clip.
  3. Add Mask from Selection: Right-click the layer, choose Add Layer Mask..., select Selection, and click Add.

Adjusting the Clipping Boundary

Because GIMP utilizes raster-based layer masks, changes to the original vector path do not automatically update the mask in real time. To adjust your clipping boundary:

  • Update the Mask After Editing: If you modify your vector path with the Paths Tool, delete the existing layer mask (right-click the layer mask thumbnail and choose Delete Layer Mask), then re-apply the updated path using the steps above.
  • Invert the Boundary: To switch between keeping the inside or outside of the path, select the layer mask thumbnail in the Layers panel, go to Colors > Invert in the main menu.