This GIMP plugin allows users to remove image backgrounds using AI-powered tools like rembg. The plugin integrates with GIMP3 to offer a simple way to remove backgrounds. It can process a single image in GIMP.
- AI-Powered Background Removal: Removes the background using the
rembgtool, an AI-powered background removal library. - Multiple AI Models: Choose from various models like u2net, isnet-general-use, sam, and more.
- Simple Integration: Works seamlessly within GIMP's interface.
- GIMP 3.0+ (available via Flatpak or native package)
- Python 3.11+ (Python 3.13 recommended for compatibility with rembg)
- rembg 2.0+ Python library
sudo apt update
sudo apt install flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo apt install gnome-software-plugin-flatpak
sudo reboot
flatpak install flathub org.gimp.GIMP
# Verify installation
flatpak list | grep gimp
flatpak run org.gimp.GIMP --version# Create plugin directory
mkdir -p ~/.config/GIMP/3.0/plug-ins/
cd ~/.config/GIMP/3.0/plug-ins/
# Download and extract the plugin
curl -L -o /tmp/gimp3-plugin.zip https://github.com/ismdevteam/gimp3-rembg-plugin/archive/refs/heads/main.zip
unzip -q /tmp/gimp3-plugin.zip
mv gimp3-rembg-plugin-main gimp3-rembg-plugin
rm /tmp/gimp3-plugin.zip
# Make the plugin executable
chmod +x gimp3-rembg-plugin/gimp3-rembg-plugin.py
# Verify files
ls -la gimp3-rembg-plugin/# Enter GIMP Flatpak environment
flatpak run --command=bash org.gimp.GIMP
python3 -m ensurepip --upgrade
# Choose ONE of the following based on your hardware:
# Option 1: For CPU processing (works on all systems)
python3 -m pip install "rembg[cpu]"
# Option 2: For NVIDIA GPU acceleration (requires CUDA-compatible GPU)
# python3 -m pip install "rembg[gpu]"
exitflatpak run org.gimp.GIMPIf you have GIMP 3.0+ installed via APT (available on Debian 13+), we strongly recommend using a Python virtual environment to install rembg – this avoids any risk of breaking system packages.
sudo apt install gimp python3-pip python3-venv# Create the venv (choose a location, e.g. ~/.gimp3-rembg-venv)
python3 -m venv ~/.gimp3-rembg-venv
# Activate it and install rembg
source ~/.gimp3-rembg-venv/bin/activate
# Choose ONE of the following based on your hardware:
# Option 1: CPU processing (works on all systems)
pip install "rembg[cpu]"
# Option 2: NVIDIA GPU acceleration (requires CUDA-compatible GPU)
# pip install "rembg[gpu]"
deactivate# Create plugin directory
mkdir -p ~/.config/GIMP/3.0/plug-ins/
cd ~/.config/GIMP/3.0/plug-ins/
# Download and extract the plugin
curl -L -o /tmp/gimp3-plugin.zip https://github.com/ismdevteam/gimp3-rembg-plugin/archive/refs/heads/main.zip
unzip -q /tmp/gimp3-plugin.zip
mv gimp3-rembg-plugin-main gimp3-rembg-plugin
rm /tmp/gimp3-plugin.zip
# Make the plugin executable
chmod +x gimp3-rembg-plugin/gimp3-rembg-plugin.pyNow we need to tell the plugin where to find the installed rembg package.
The easiest way is to add the venv’s site-packages directory to Python’s search path at the very beginning of the plugin script.
Run this command to automatically insert the correct path:
VENV_SITE=$(~/.gimp3-rembg-venv/bin/python -c "import site; print(site.getsitepackages()[0])")
sed -i "1i import sys; sys.path.insert(0, '$VENV_SITE')" ~/.config/GIMP/3.0/plug-ins/gimp3-rembg-plugin/gimp3-rembg-plugin.pyThis will prepend the venv’s package directory to sys.path so that GIMP’s Python interpreter can find rembg.
gimp
⚠️ Expert-only fallback – not recommended
If you absolutely cannot use a virtual environment and are fully aware of the risks, you can force‑installrembginto the system Python using--break-system-packages. This may break other system tools that rely on Python. Use only in a dedicated virtual machine or test environment, and at your own risk.python3 -m pip install --user "rembg[cpu]" --break-system-packages
- Open GIMP and load an image.
- Go to Filters → Development → ISM Tools AI Filters → AI Remove Background...
- Configure the options:
- Model: Choose which AI model to use for background removal (default: u2net).
- Click OK to run the plugin.
On the first run with a new model:
- The AI model files will be downloaded automatically (approximately 176MB for u2net)
- This may take a few minutes depending on your internet connection
- Files are saved to:
- Flatpak:
~/.var/app/org.gimp.GIMP/data/.u2net/ - Native:
~/.u2net/
- Flatpak:
- Subsequent runs will be faster as models are cached locally
Example download progress:
Downloading data from 'https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx' to file '/home/user/.var/app/org.gimp.GIMP/data/.u2net/u2net.onnx'.
100%|████████████████████████████████| 176M/176M [00:00<00:00, 254GB/s]
The plugin supports all models available in rembg 2.0+, including:
u2net(default) - General purpose modelu2netp- Lightweight version of u2netisnet-general-use- High quality general segmentationisnet-anime- Optimized for anime/manga imagessam- Segment Anything Model (requires specific prompts)birefnet-general- Advanced general purpose modelbria-rmbg- State-of-the-art model by BRIA AI
- Verify the plugin is in
~/.config/GIMP/3.0/plug-ins/gimp3-rembg-plugin/ - Ensure
gimp3-rembg-plugin.pyis executable (chmod +x) - Restart GIMP completely
- For Flatpak: ensure you installed rembg inside the Flatpak environment (Step 3 for Flatpak installation)
- For native with venv: verify that the
sedcommand inserted the correct path. You can manually check the plugin file – the first line should beimport sys; sys.path.insert(0, '/home/your_user/.gimp3-rembg-venv/lib/python3.x/site-packages')
- Ensure network connectivity
- Check disk space in your home directory
- The CPU backend is slower. If you have a compatible NVIDIA GPU, use
rembg[gpu]instead ofrembg[cpu] - Larger images take more time. Consider resizing very large images first
Feel free to open issues or submit pull requests to improve this plugin! Contributions are always welcome.
This project is licensed under the GPLv3 License - see the LICENSE file for details.
- rembg: This plugin integrates with rembg to handle AI-powered background removal.
- GIMP: The GNU Image Manipulation Program, a free and open-source image editor.
- All AI model contributors: For making their models available for public use.