image-watermark-remover 2025.12.21100706
A new package designed to assist users in removing watermarks from images by leveraging a language model-based approach. It accepts descriptive text about the image and watermark, then guides the mode
License: MIT
Requires Python: >=3.9

# image_watermark_remover
[![PyPI version](https://badge.fury.io/py/image-watermark-remover.svg)](https://badge.fury.io/py/image-watermark-remover)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/image-watermark-remover)](https://pepy.tech/project/image-watermark-remover)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)


A Python package designed to assist users in removing watermarks from images using a language model-based approach. It processes descriptive text about the image and watermark, then generates structured guidance or cleaned versions for watermark removal, ensuring consistent and reliable outputs.

---

## 📌 Overview
The `image_watermark_remover` package leverages a language model to analyze user-provided text about an image and its watermark. It provides structured responses or removal techniques, making it ideal for workflows requiring accurate watermark elimination guidance.

Key Features:
- **Pattern-Matching Outputs**: Ensures consistent and structured responses.
- **LLM Flexibility**: Works with default `ChatLLM7` or custom LLM backends (e.g., OpenAI, Anthropic, Google).
- **Environment-Aware**: Uses `LLM7_API_KEY` from environment variables or direct input.

---

## 📦 Installation

Install via pip:

```bash
pip install image_watermark_remover
```

---

## 🚀 Usage

### Basic Usage (Default LLM: `ChatLLM7`)
```python
from image_watermark_remover import image_watermark_remover

# Example: Remove watermark from an image described as "a photo of a cat with a logo in the corner"
response = image_watermark_remover(
    user_input="Describe the watermark removal process for this image: [image description here]."
)
print(response)
```

### Custom LLM Integration
You can override the default `ChatLLM7` with other LLMs like OpenAI, Anthropic, or Google.

#### Example with OpenAI:
```python
from langchain_openai import ChatOpenAI
from image_watermark_remover import image_watermark_remover

llm = ChatOpenAI()
response = image_watermark_remover(
    user_input="Describe how to remove a watermark from this image: [image description].",
    llm=llm
)
print(response)
```

#### Example with Anthropic:
```python
from langchain_anthropic import ChatAnthropic
from image_watermark_remover import image_watermark_remover

llm = ChatAnthropic()
response = image_watermark_remover(
    user_input="Explain watermark removal for this image: [image description].",
    llm=llm
)
print(response)
```

#### Example with Google:
```python
from langchain_google_genai import ChatGoogleGenerativeAI
from image_watermark_remover import image_watermark_remover

llm = ChatGoogleGenerativeAI()
response = image_watermark_remover(
    user_input="Guide me on removing a watermark from this image: [image description].",
    llm=llm
)
print(response)
```

---

## 🔑 API Key Configuration
- **Default**: Uses `LLM7_API_KEY` from environment variables.
- **Manual Override**: Pass the API key directly:
  ```python
  response = image_watermark_remover(
      user_input="...",
      api_key="your_llm7_api_key_here"
  )
  ```

Get a free API key from [LLM7](https://token.llm7.io/).

---

## 📝 Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| `user_input` | `str` | Descriptive text about the image and watermark. |
| `api_key` | `Optional[str]` | LLM7 API key (optional if `LLM7_API_KEY` is set). |
| `llm` | `Optional[BaseChatModel]` | Custom LLM instance (e.g., `ChatOpenAI`, `ChatAnthropic`). Defaults to `ChatLLM7`. |

---

## ⚠️ Notes
- **Rate Limits**: The default `LLM7` free tier is sufficient for most use cases. For higher limits, use your own API key.
- **Output Consistency**: Responses adhere to predefined patterns for structured results.

---

## 📜 License
MIT License (see [LICENSE](https://github.com/chigwell/image-watermark-remover/blob/main/LICENSE)).

---

## 📢 Support & Issues
For bugs or feature requests, open an issue on [GitHub](https://github.com/chigwell/image-watermark-remover/issues).

---

## 👤 Author
**Eugene Evstafev** ([@chigwell](https://github.com/chigwell))
📧 [hi@euegne.plus](mailto:hi@euegne.plus)