Skip to content

zquestz/dream-background-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dream Background Remover - GIMP Plugin

Dream Background Remover brings Replicate's AI capabilities directly into GIMP for intelligent background removal.

Dream Background Remover

Features

  • ๐ŸŽจ AI Background Removal: Remove backgrounds from your images
  • ๐Ÿค– AI Model Selection: Choose between multiple models
  • ๐Ÿ”„ Smart Layer Management: Automatically creates properly named layers
  • ๐ŸŒ Multi-Language Support: Setup to support multiple languages via i18n
  • ๐Ÿ—๏ธ Native GIMP Integration: Works seamlessly within your GIMP workflow

Installation

Prerequisites

  • GIMP 3.0.x
  • Python 3.8+
  • Replicate API key (paid account required)

Install the required Python library:

pip install replicate

Quick Install

  1. Download the latest release from GitHub Releases

  2. Extract the release

    This will create a folder named dream-background-remover-{version} (e.g., dream-background-remover-1.0.5)

  3. Move to your GIMP plugins folder with the correct name:

    Rename and move the extracted folder to exactly dream-background-remover in your GIMP plugins directory:

    • Linux: ~/.config/GIMP/3.0/plug-ins/dream-background-remover/
    • Windows: %APPDATA%\GIMP\3.0\plug-ins\dream-background-remover\
    • macOS: ~/Library/Application Support/GIMP/3.0/plug-ins/dream-background-remover/

    Example for Linux:

    # Extract creates dream-background-remover-1.0.5/
    unzip dream-background-remover-1.0.5.zip
    # Move to correct location with correct name
    mv dream-background-remover-1.0.5 ~/.config/GIMP/3.0/plug-ins/dream-background-remover
  4. Make executable (Linux/macOS only):

    chmod +x ~/.config/GIMP/3.0/plug-ins/dream-background-remover/dream-background-remover.py
  5. Restart GIMP

Building translations (optional): If you need languages other than English, run python3 scripts/build-translations.py in the plugin directory after installation.

Arch Linux Installation

To install Dream Background Remover on Arch Linux, you can install it from the AUR.

yay -S dream-background-remover

Advanced Installation

Manual Installation from Source

  1. Find your GIMP plugins directory (paths listed above)

  2. Create plugin directory:

    mkdir -p ~/.config/GIMP/3.0/plug-ins/dream-background-remover/
  3. Copy all Python files:

    cp *.py ~/.config/GIMP/3.0/plug-ins/dream-background-remover/
  4. Build and install translations (Optional):

    python3 scripts/build-translations.py
    cp -r locale ~/.config/GIMP/3.0/plug-ins/dream-background-remover/
  5. Make executable:

    chmod +x ~/.config/GIMP/3.0/plug-ins/dream-background-remover/dream-background-remover.py

Development Setup

git clone https://github.com/zquestz/dream-background-remover.git
cd dream-v
pip install replicate
python3 scripts/build-translations.py # optional, defaults to English
ln -s $(pwd) ~/.config/GIMP/3.0/plug-ins/dream-background-remover

Python Dependencies Note

Important: Use the same Python that GIMP uses. If pip install replicate doesn't work:

# System-wide installation
sudo pip install replicate

# User installation (recommended)
pip install --user replicate

# Ensure Python 3
pip3 install replicate

macOS Instructions

If you get the "replicate not installed" error on macOS:

  1. Locate GIMP's Python by opening the Python Console: Filters โ†’ Development โ†’ Python-Fu

  2. Run this command in the console:

    import sys; print(sys.executable)

    You should see something like:

    /Applications/GIMP.app/Contents/MacOS/python3
    
  3. Install replicate using GIMP's Python from Terminal:

    # Change to GIMP's Python directory
    cd /Applications/GIMP.app/Contents/MacOS
    
    # Ensure pip is installed
    ./python3 -m ensurepip
    
    # Install replicate
    ./python3 -m pip install replicate

Getting Your API Key

  1. Visit Replicate
  2. Generate an API key
  3. Keep your key secure and monitor usage/costs

API Specifications

  • 851 Labs Background Remover: 851-labs/background-remover (Default - Fast and cost-effective)
  • Bria Remove Background: bria/remove-background (High quality, more expensive)
  • Recraft Remove Background: recraft-ai/recraft-remove-background (Tuned for AI, balanced performance)

Users can select their preferred model in the plugin interface.

Cost Considerations

  • Each image generation/edit counts toward your API usage
  • Monitor your usage at Replicate to avoid unexpected charges

Usage

Basic Workflow

  1. Open an image in GIMP
  2. Launch Dream Background Remover: Filters โ†’ AI โ†’ Dream Background Remover...
  3. Enter your API key (saved automatically for future use)
  4. Select AI model:
    • 851 Labs Background Remover: Fast and cost-effective (recommended for most users)
    • Bria Remove Background: Higher quality results, higher cost
    • Recraft Remove Background: Tuned for AI, balanced performance and cost
  5. Select mode:
    • Create Layer: Creates a layer in your current image with the background removed
    • Create File: Create a new image with your background removed
  6. Generate: Click "Remove Background" and watch the progress
  7. Result: New layer or file appears with the background removed

Language Support

Available Languages

Dream Background Remover is fully translated and available in:

  • ๐Ÿ‡บ๐Ÿ‡ธ English (default)
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish (complete)
  • ๐Ÿ‡ซ๐Ÿ‡ท French (complete)
  • ๐Ÿ‡ต๐Ÿ‡น Portuguese (complete)
  • ๐Ÿ‡ท๐Ÿ‡บ Russian (complete)
  • ๐Ÿ‡ฏ๐Ÿ‡ต Japanese (complete)
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Hindi (complete)
  • ๐Ÿ‡ง๐Ÿ‡ฉ Bengali (complete)
  • ๐Ÿ‡จ๐Ÿ‡ณ Chinese (Simplified) (complete)
  • ๐Ÿ‡น๐Ÿ‡ผ Chinese (Traditional) (complete)
  • ๐Ÿ‡ฐ๐Ÿ‡ท Korean (complete)

The plugin automatically detects your system language and uses the appropriate translation. If your language isn't available, it defaults to English.

For Developers

# Extract new translatable strings
python3 scripts/update-pot.py

# Update existing translations
python3 scripts/update-translations.py

# Build compiled translations
python3 scripts/build-translations.py

Architecture

The plugin is organized into focused modules:

  • dream-background-remover.py - Main GIMP plugin entry point
  • dialog_gtk.py - GTK user interface components
  • dialog_events.py - Event handling and user interactions
  • dialog_threads.py - Background processing and threading
  • api.py - Replicate API integration
  • integrator.py - GIMP-specific operations
  • settings.py - Configuration persistence
  • i18n.py - Internationalization support

Troubleshooting

Common Issues

"replicate not installed" warning

  • Install with: pip install replicate
  • Ensure you're using GIMP's Python environment

Plugin doesn't appear in menu

  • Check file permissions: chmod +x dream-background-remover.py
  • Restart GIMP after installation
  • Verify files are in correct plugins directory

API errors

  • Verify your API key is correct
  • Check your quota at Replicate
  • Monitor costs to avoid unexpected charges

Interface problems

  • Check GIMP's Error Console: Windows โ†’ Dockable Dialogs โ†’ Error Console
  • Ensure translations are built: python3 scripts/build-translations.py
  • Report UI issues with screenshots

Getting Help

  1. Check the Error Console in GIMP for specific error messages
  2. Verify all requirements are installed correctly
  3. Check file permissions on the plugin directory
  4. Review API quotas if getting timeout errors

Contributing

For Translators

We welcome translations! Here's how to contribute:

  1. Copy the template: cp locale/dream-background-remover.pot locale/[YOUR_LANG].po
  2. Translate the strings using Poedit, Lokalize, or any text editor
  3. Test your translation: Build with python3 scripts/build-translations.py
  4. Submit a pull request with your .po file

Translation Guidelines:

  • Keep UI text concise but clear
  • Use GIMP's existing terminology for your language
  • Preserve HTML tags and placeholders like {count}, {url}
  • Test that text fits in the interface

For Developers

  1. Fork the repository
  2. Create a feature branch
  3. Follow the existing code style
  4. Update translations if adding new strings
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Built with the Replicate API.

About

A GIMP plugin to remove image backgrounds

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages