Red Pen Mark Remover

Removes red handwritten marks from scanned documents and images using color detection and inpainting algorithms.

12 stars

Best use case

Red Pen Mark Remover is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Removes red handwritten marks from scanned documents and images using color detection and inpainting algorithms.

Teams using Red Pen Mark Remover should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/red-pen-remover/SKILL.md --create-dirs "https://raw.githubusercontent.com/lotosbin/claude-skills/main/.claude/skills/red-pen-remover/Skill.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/red-pen-remover/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How Red Pen Mark Remover Compares

Feature / AgentRed Pen Mark RemoverStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Removes red handwritten marks from scanned documents and images using color detection and inpainting algorithms.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Red Pen Mark Remover

Removes red handwritten marks from scanned documents and images using color detection and inpainting algorithms.

## Installation

```bash
pip install opencv-python pillow numpy
```

## Usage

### Python API

```python
from red_pen_remover import remove_red_marks, batch_remove_red_marks, preview_masks

# Single image
remove_red_marks("document.jpg", "clean_document.jpg")

# Adjust sensitivity (0.0-1.0, lower = more aggressive)
remove_red_marks("document.jpg", "clean.jpg", sensitivity=0.2)

# Batch processing
batch_remove_red_marks("input_folder/", "output_folder/")

# Preview mask detection
preview_masks("document.jpg", "preview.jpg")
```

### Command Line

```bash
python red_pen_remover.py input.jpg output.jpg [sensitivity]
```

## Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| input_path | str | - | Path to input image |
| output_path | str | - | Path to save output |
| sensitivity | float | 0.3 | Color detection sensitivity (0.0-1.0) |
| radius | int | 3 | Inpainting radius |
| method | str | "telea" | Inpainting method: "telea" or "ns" |

## Tips

- **High sensitivity (0.4-0.5)**: Better for bright, clear scans
- **Low sensitivity (0.1-0.2)**: Better for dark or noisy images
- Use `preview_masks()` to tune sensitivity before processing
- Works best on documents with clear contrast between text and marks

## How It Works

1. **Color Detection**: Converts image to HSV color space and identifies red pixels
2. **Mask Processing**: Applies morphological operations to clean up the mask
3. **Inpainting**: Uses OpenCV's inpainting algorithm to fill in removed regions

Related Skills

We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.