Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

long-image-ocr

A Claude Code skill that accurately transcribes text from long/tall screenshots by splitting them into overlapping segments.

Problem

LLMs struggle with very tall images (chat screenshots, long articles, scrolling captures). Text recognition accuracy degrades significantly as image height increases.

Solution

This skill:

  1. Splits the image into small overlapping vertical segments (auto-calculated optimal size)
  2. Reads each segment individually where OCR accuracy is high
  3. Merges results intelligently by removing duplicated overlap content

Install

As a Claude Code Skill (recommended)

# Clone to your personal skills directory
git clone https://github.com/yytyyf/long-image-ocr-skill.git ~/.claude/skills/long-image-ocr

As a Claude Code Plugin

Add to your .claude/plugins.json:

{
  "plugins": [
    "https://github.com/yytyyf/long-image-ocr-skill"
  ]
}

Usage

Automatic

Simply paste or reference a long screenshot in your Claude Code conversation. Claude will detect the need and invoke the skill automatically.

Manual

/long-image-ocr /path/to/your/long-screenshot.png

With custom output path:

/long-image-ocr /path/to/image.png /path/to/output.md

Requirements

  • Python 3.8+
  • Pillow (pip install Pillow)

How it works

The splitting algorithm:

  • Auto-calculates optimal segment height based on image dimensions (600-2000px)
  • Uses 200px overlap between segments to prevent cutting through text lines
  • Wider images get shorter segments to stay within vision model token limits

The merging algorithm:

  • Claude reads each segment and transcribes the text
  • Adjacent segments share ~200px of overlapping content
  • Claude identifies and removes duplicate content from overlap zones
  • Result is a clean, continuous transcription

Supported content types

  • Chat/messaging screenshots (WeChat, Slack, Discord, etc.)
  • Long article screenshots
  • Code screenshots
  • Document scans
  • Any tall/scrolling capture

License

MIT

About

Claude Code skill: Accurately transcribe text from long/tall screenshots by splitting into overlapping segments

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages