Automatically scroll and capture WeChat chat windows on Windows, with optional OCR text recognition and Markdown export.
A Windows desktop tool (Python + Tkinter) that captures long WeChat chat conversations by automatically scrolling the chat window and stitching the captured screenshots. It is the "screenshot" equivalent of a long-page capture for chat records.
- Region selection — drag to select the exact chat area on screen
- Auto-scroll capture — scrolls the chat window automatically; configurable scroll distance (supports decimals) and capture interval
- Smart stop — stops automatically when reaching the top of the chat, or manually via ESC / stop button
- Optional OCR dedup — uses RapidOCR (ONNX Runtime) to recognize text, deduplicate overlapping screenshots, and avoid saving duplicates
- Live text preview — OCR results displayed in real time, split into left/right speaker columns
- Markdown export — each screenshot's recognized text is saved to a
*.mdfile alongside it - Dark UI — clean dark theme, DPI-aware, runs with low CPU usage (OCR thread-limited)
- Config persistence — region, scroll distance, interval and OCR settings are remembered across sessions
- Windows 10/11
- Python 3.8+
- Dependencies:
Pillow,pywin32,numpy,rapidocr-onnxruntime
pip install Pillow pywin32 numpy rapidocr-onnxruntimepython wechat_capture_tool.py- Click Select Region (框选捕获区域) and drag to cover the chat message area
- Click Save Folder (选择保存文件夹) to pick the output directory
- Click Start Capture (开始捕获) — a 3-second countdown lets you switch to the WeChat window
- Capture runs automatically; press ESC or click Stop (停止) to finish
Screenshots are saved as chat_000001.png, chat_000002.png, ... plus a chat_*.md file with the recognized text for each.
| File | Description |
|---|---|
wechat_capture_tool.py |
Main GUI tool |
e2e_test.py |
End-to-end driver test against a real WeChat window (dev helper) |
organize_chat.py |
Standalone utility: OCR a batch of chat screenshots → dedupe → sort by time → output one conversation .md |
MIT
一个基于 Python + Tkinter 的 Windows 桌面工具,用于自动滚动截取微信聊天记录长图。框选聊天区域后,程序自动滚动聊天窗口并逐帧截屏,相当于聊天记录的"长截图"工具。可选内置 OCR 文本识别,自动去重并生成 Markdown 文本。
- 框选区域 — 拖动鼠标精确框选聊天内容区域
- 自动滚动截屏 — 自动滚动聊天窗口,滚动距离(支持小数)与截屏间隔可调
- 智能停止 — 滚动到顶部自动停止,也可按 ESC 或点击"停止"手动结束
- OCR 可选去重 — 基于 RapidOCR(ONNX Runtime)识别文本,重叠内容 ≥95% 判定为无新内容,自动跳过重复截图
- 实时文本预览 — 识别结果实时显示,自动按左右分列(发送/接收)
- Markdown 导出 — 每张截图的识别文本同步保存为同目录下的
*.md文件 - 深色界面 — 干净深色主题,DPI 感知,OCR 限线程数避免占满 CPU
- 配置记忆 — 捕获区域、滚动距离、间隔、OCR 开关等设置自动保存
- Windows 10/11
- Python 3.8+
- 依赖:
Pillow、pywin32、numpy、rapidocr-onnxruntime
pip install Pillow pywin32 numpy rapidocr-onnxruntimepython wechat_capture_tool.py- 点击「框选捕获区域」,拖动鼠标覆盖聊天消息区域
- 点击「选择保存文件夹」指定输出目录
- 点击「开始捕获」,3 秒倒计时内切换到微信窗口
- 自动滚动截屏,按 ESC 或点击「停止」结束
截图保存为 chat_000001.png、chat_000002.png…… 每张截图同时生成对应的 chat_*.md 识别文本文件。
| 文件 | 说明 |
|---|---|
wechat_capture_tool.py |
主程序(GUI 工具) |
e2e_test.py |
端到端驱动测试,在真实微信窗口上验证全流程(开发辅助) |
organize_chat.py |
独立工具:批量 OCR 聊天截图 → 去重 → 按时间排序 → 输出对话 md |
MIT