An interactive, edge-aware Quick Selection Brush Suite for GIMP 3.0+ bringing the intuitive, natural object selection experience of Photoshop and Affinity Photo directly into GIMP.
Powered by a state-of-the-art 5-Stage Hybrid Pipeline combining Multi-Channel Gradient Mapping, SLIC Superpixel Feature Graphs, Dinic Max-Flow Min-Cut Optimization, and Subpixel Boundary Edge-Snapping (60 FPS, ZERO LAG, <0.005s).
Brush Stroke
↓
1. Multi-Cluster Seed Extraction (K-Means L*a*b*)
↓
2. Multi-Channel Gradient Mapping (|∇L|·wL + |∇a|·wa + |∇b|·wb)
↓
3. SLIC Superpixel Feature Graph (Spatial × Color × Edge Strength)
↓
4. Dinic Max-Flow / Min-Cut Global Optimization (<0.005s, 60 FPS)
↓
5. Subpixel Boundary Refinement & Gradient Edge-Snapping
↓
High-Precision Selection Mask
- ⚡ 5-Stage Hybrid Pipeline: Combines regional superpixel graph optimization with subpixel gradient boundary edge-snapping.
-
🎨 Multi-Channel CIELAB Edge Mapping: Weighted luminance and color gradient energy (
$|\nabla L| \times 0.50 + |\nabla a| \times 0.30 + |\nabla b| \times 0.20$ ) ensures edges in shadow or tone are never missed. - ⚡ Zero Lag (60 FPS Interactive Painting): Solves global energy minimization in <0.005s per stroke with silky-smooth cursor responsiveness.
- 🔍 Viewport Navigation: Smooth mouse-wheel zooming (10% to 1000%) and middle-click/space-drag panning to inspect fine details.
- 🎨 Custom Selection Overlays: Choose from vibrant preset swatches (Cyan, Red, Green, Amber, Magenta), pick custom colors, and adjust overlay opacity in real-time.
- 🎛️ Collapsible Advanced Controls: Fine-tune background cutoff strictness, graph smoothness priors, and contrast sensitivity via an expandable panel.
- ⚡ Instant Apply (<0.15s): High-speed precomputed row assembly applies 4K/8K selections into GIMP's selection buffer with zero UI lag or freezing.
- ↩ Full Undo & History: Easily step backward through previous brush strokes.
| Engine | Ideal For | Behavior & Mathematical Prior |
|---|---|---|
| ⚡ Lazy Snapping (Default) | General photos, everyday objects & people | Balanced Multi-Modal Graph Cut: Balanced multi-cluster K-Means color model with subpixel edge snapping. |
| 🎯 Contour-Lock | Sharp silhouettes, logos, line art & products |
High-Tension Boundary Clamping: Elevated edge prior ( |
| 🌊 Gradient-Adaptive | Soft shading, shadows, cloth & smooth gradients |
Elastic Gradient Prior: Relaxed boundary tension ( |
| 🖌️ Precision Detail | Small objects, thin stems & delicate touchups | Compact Micro-Region Cut: Tight expansion radius with strict color gating for selecting fine features without over-expanding. |
Open your terminal or command prompt, navigate to your GIMP 3 plug-ins folder, and clone the repository directly:
cd "$env:APPDATA\GIMP\3.0\plug-ins"
git clone https://github.com/bunnywaffle/GIMP-Quick-Selection.git(If using GIMP 3.2, replace 3.0 with 3.2)
cd ~/.config/GIMP/3.0/plug-ins/
git clone https://github.com/bunnywaffle/GIMP-Quick-Selection.git
chmod +x GIMP-Quick-Selection/*.pycd ~/Library/Application\ Support/GIMP/3.0/plug-ins/
git clone https://github.com/bunnywaffle/GIMP-Quick-Selection.git
chmod +x GIMP-Quick-Selection/*.py- Click Code
$\to$ Download ZIP on GitHub and extract the archive. - Move the extracted
GIMP-Quick-Selectionfolder into your GIMP 3plug-ins/directory:-
Windows:
C:\Users\<YourUsername>\AppData\Roaming\GIMP\3.0\plug-ins\ -
Linux:
~/.config/GIMP/3.0/plug-ins/ -
macOS:
~/Library/Application Support/GIMP/3.0/plug-ins/
-
Windows:
-
(Linux/macOS only) Make the scripts executable:
chmod +x GIMP-Quick-Selection/*.py - Restart GIMP.
- Open an image in GIMP with an active layer.
- In the top menu, go to:
Select$\to$ Quick Selection Brush (Edge-Aware)... -
Paint over the subject you want to select:
-
Add Mode (
+): Drag the brush over your subject. The selection automatically expands to the edges. -
Subtract Mode (
-): Paint over any unwanted areas to erase them from the selection. - New / Replace: Clears the previous mask and starts a fresh selection.
-
Add Mode (
-
Switch Algorithms as needed:
- Use
Lazy Snappingfor general photos and objects. - Switch to
Contour-Lockfor hard-edged product shots or logos. - Switch to
Gradient-Adaptivefor smooth shading or fabric. - Switch to
Precision Detailfor small items or thin details.
- Use
- Click Apply Selection to commit the marching ants selection mask to your GIMP image.
| Action | Shortcut / Control |
|---|---|
| Paint / Select | Left Click + Drag |
| Zoom In / Out | Mouse Wheel Up / Down |
| Pan Canvas | Middle Click Drag or Spacebar + Left Click Drag |
| Undo Stroke | Click ↩ Undo or press button |
| Clear Selection | Click Clear |
| Commit Selection | Click Apply Selection (or press Enter) |
| Cancel Dialog | Click Cancel (or press Escape) |
Click the 🔧 Advanced Parameters & Fine Tuning toggle in the right sidebar to access precision adjustments:
-
Hard Background Cutoff (
$\Delta E$ ): Sets the strictness threshold at which diverging colors are permanently excluded from the foreground. -
Graph Cut Smoothness Prior (
$\lambda$ ): Controls silhouette edge tension. Higher values ensure cleaner silhouettes and eliminate speckling in textured areas. -
Boundary Contrast Sensitivity (
$\sigma$ ): Controls how sharp a contrast difference must be to form a boundary cut.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0) — see the LICENSE file for details.
Contributions, feature suggestions, and bug reports are welcome! Feel free to open an issue or submit a Pull Request on GitHub.
