MCP HubMCP Hub
libreearth

gimp-mcp

by: libreearth

Gimp MCP Server

27created 18/03/2025
Visit
Gimp

📌Overview

Purpose: The GIMP-MCP initiative aims to enhance the GNU Image Manipulation Program (GIMP) by integrating the Model Context Protocol (MCP) for seamless interaction between GIMP and AI models, allowing users to leverage advanced AI capabilities in image editing.

Overview: GIMP-MCP facilitates the use of AI for tasks like object recognition, style transfer, and automated enhancements within GIMP, making image editing more efficient and intelligent. This integration provides users with context-aware operations that enhance their editing workflows.

Key Features:

  • AI Integration: Connects GIMP with advanced AI models for enhanced image processing capabilities, empowering users to perform complex tasks more easily.

  • Automated Workflows: Enables the use of AI for repetitive tasks, increasing editing efficiency and allowing users to focus on more creative aspects.

  • Context-Aware Operations: AI models can understand and manipulate images based on context, leading to more intelligent and nuanced edits.


GIMP-MCP: Integrating GIMP with AI through Model Context Protocol

GIMP-MCP integrates the Model Context Protocol (MCP) into GIMP, allowing users to harness AI capabilities for enhanced image editing.

Table of Contents

Introduction

The Model Context Protocol (MCP) is an open standard designed for integration between AI systems and applications. With MCP in GIMP, users can employ AI for tasks such as object recognition and automated enhancements, enhancing GIMP's functionalities.

Features

  • AI Integration: Connect GIMP with advanced AI models for improved image processing.
  • Automated Workflows: Utilize AI for repetitive tasks, improving editing efficiency.
  • Context-Aware Operations: AI models interpret images for intelligent edits.

Installation

Prerequisites

  • GIMP 2.10 or later
  • Python 3.x
  • Basic knowledge of Python scripting and GIMP's plugin architecture.

Setting Up the MCP Server

  1. Clone the MCP Repository:

    git clone https://github.com/modelcontextprotocol/servers.git
    cd servers
    
  2. Install Dependencies:

    pip install -r requirements.txt
    
  3. Run the MCP Server:

    python mcp_server.py
    

Integrating MCP with GIMP

  1. Locate GIMP’s Plugin Directory:

    • Linux: ~/.config/GIMP/2.10/plug-ins/
    • Windows: C:\Users\<username>\AppData\Roaming\GIMP\2.10\plug-ins\
    • macOS: ~/Library/Application Support/GIMP/2.10/plug-ins/
  2. Copy the Plugin File:

    • Place gimp_mcp_plugin.py in the plugin directory.
  3. Make the Plugin Executable (Linux/macOS):

    chmod +x ~/.config/GIMP/2.10/plug-ins/gimp_mcp_plugin.py
    
  4. Restart GIMP to recognize the new plugin.

Usage Examples

AI-Powered Background Removal

  1. Open an Image in GIMP.
  2. Navigate to Filters > AI Tools > Remove Background to automatically remove backgrounds.

Image Inpainting with AI

  1. Use selection tools to highlight an area for inpainting.
  2. Go to Filters > AI Tools > Inpaint Selection to reconstruct the selected area.

Human-AI Interaction Prompts

  • Object Recognition: “Identify and select all objects in the image.”
  • Style Transfer: “Apply Van Gogh’s Starry Night style to the current image.”
  • Image Enhancement: “Enhance the image resolution and reduce noise.”

Available API Commands

  • gimp_image_new: Create a new image.
  • gimp_layer_new: Add a new layer to an image.
  • gimp_text_layer_new: Create a new text layer.
  • gimp_file_load: Load an image file.
  • gimp_file_save: Save the current image to a file.
  • gimp_edit_fill: Fill a selection or layer with a specified color.
  • gimp_context_set_foreground: Set the foreground color.
  • gimp_layer_set_offsets: Set the position of a layer.

For a comprehensive list of commands, refer to the GIMP Python API documentation.

Contributing

We welcome contributions to enhance GIMP-MCP:

  1. Fork the Repository.

  2. Create a Feature Branch:

    git checkout -b feature/your-feature-name
    
  3. Commit Your Changes:

    git commit -m "Add feature: your feature description"
    
  4. Push to Your Fork:

    git push origin feature/your-feature-name
    
  5. Submit a Pull Request.

License

This project is licensed under the MIT License.

Acknowledgments

We thank developers and researchers contributing to AI capabilities within GIMP.

Note: This integration is ongoing; check for the latest updates and community support.