首次运行会自动下载约 400 MB 模型,需等待日志出现 OCR ready;需 Python 3.9 以上,且最新 Python 版本可能因 PyTorch 依赖尚不支持;Linux 剪贴板模式需装 wl-copy(Wayland)或 xclip(X11),且剪贴板模式会把你复制的图片替换成文字。
manga-ocr
kha-whiteApache-2.0活跃维护面向日文漫画的 OCR 工具,能识别漫画中的对话气泡和拟声词等文字,基于 Transformers 实现,适合做漫画翻译或文本提取。
Optical character recognition for Japanese text, with the main focus being Japanese manga
pip install manga-ocr
mocr = MangaOcr(); text = mocr('/path/to/img')README 未说明显存要求;默认可用 CPU 运行,如需 GPU 需按 PyTorch 官网说明自行安装对应版本 PyTorch。
专为日文漫画打造的端到端 OCR,能一次识别整段对话气泡里的竖排、横排和带注音文字
面向日文漫画的 OCR 工具,能识别漫画中的对话气泡和拟声词等文字,基于 Transformers 实现,适合做漫画翻译或文本提取。
核心能力
- 基于 Transformers Vision Encoder Decoder 的端到端模型
- 单次前向即可识别多行文本,无需先切分气泡
- 对竖排横排、注音、叠字图像和低质图更鲁棒
- 支持 Python API 与剪贴板/文件夹后台监听模式
- 识别结果可直接写入剪贴板供词典工具取词
容易踩的坑
- v0.1.16最新正式版2026-07-19 · 2026-07-19 08:44 UTC
What's Changed
- Require transformers>=4.45.0 by @kha-white in https://github.com/kha-white/manga-ocr/pull/107
Full Changelog: https://github.com/kha-white/manga-ocr/compare/v0.1.15...v0.1.16
- v0.1.152026-07-11 · 2026-07-11 23:00 UTC
查看更新说明
What's Changed
- Update README.md by @kaiserinn in https://github.com/kha-white/manga-ocr/pull/91
- Fix transformers 5 tokenizer by @kha-white in https://github.com/kha-white/manga-ocr/pull/106
New Contributors
- @kaiserinn made their first contribution in https://github.com/kha-white/manga-ocr/pull/91
Full Changelog: https://github.com/kha-white/manga-ocr/compare/v0.1.14...v0.1.15
- v0.1.142025-01-01 · 2025-01-01 20:10 UTC
这个版本没有写更新说明。
- v0.1.132024-10-11 · 2024-10-11 15:07 UTC
这个版本没有写更新说明。
- v0.1.122024-06-21 · 2024-06-21 23:51 UTC
这个版本没有写更新说明。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Manga OCR
Optical character recognition for Japanese text, with the main focus being Japanese manga. It uses a custom end-to-end model built with Transformers' Vision Encoder Decoder framework.
Manga OCR can be used as a general purpose printed Japanese OCR, but its main goal was to provide a high quality text recognition, robust against various scenarios specific to manga:
- both vertical and horizontal text
- text with furigana
- text overlaid on images
- wide variety of fonts and font styles
- low quality images
Unlike many OCR models, Manga OCR supports recognizing multi-line text in a single forward pass, so that text bubbles found in manga can be processed at once, without splitting them into lines.
See also:
- Poricom, a GUI reader, which uses manga-ocr
- mokuro, a tool, which uses manga-ocr to generate an HTML overlay for manga
- Xelieu's guide, a comprehensive guide on setting up a reading and mining workflow with manga-ocr/mokuro (and many other useful tips)
- Development code, including code for training and synthetic data generation: link
- Description of synthetic data generation pipeline + examples of generated images: link
Installation
You need Python 3.9 or newer. Please note, that the newest Python release might not be supported due to a PyTorch dependency, which often breaks with new Python releases and needs some time to catch up. Refer to PyTorch website for a list of supported Python versions.
Some users have reported problems with Python installed from Microsoft Store. If you see an error:
ImportError: DLL load failed while importing fugashi: The specified module could not be found.,
try installing Python from the official site.
If you want to run with GPU, install PyTorch as described here, otherwise this step can be skipped.
Install with pip:
pip install manga-ocr
Or with uv:
uv add manga-ocr
You can also run manga-ocr without installing it into your project, using uvx:
uvx manga_ocr
Troubleshooting
ImportError: DLL load failed while importing fugashi: The specified module could not be found.- might be because of Python installed from Microsoft Store, try installing Python from the official site- problem with installing
mecab-python3on ARM architecture - try this workaround
Usage
Python API
from manga_ocr import MangaOcr
mocr = MangaOcr()
text = mocr('/path/to/img')
or
import PIL.Image
from manga_ocr import MangaOcr
mocr = MangaOcr()
img = PIL.Image.open('/path/to/img')
text = mocr(img)
Running in the background
Manga OCR can run in the background and process new images as they appear.
You might use a tool like ShareX or Flameshot to manually capture a region of the screen and let the OCR read it either from the system clipboard, or a specified directory. By default, Manga OCR will write recognized text to clipboard, from which it can be read by a dictionary like Yomitan.
Clipboard mode on Linux requires wl-copy for Wayland sessions or xclip for X11 sessions. You can find out which one your system needs by running echo $XDG_SESSION_TYPE in the terminal.
Your full setup for reading manga in Japanese with a dictionary might look like this:
capture region with ShareX -> write image to clipboard -> Manga OCR -> write text to clipboard -> Yomitan
- To read images from clipboard and write recognized texts to clipboard, run in command line:
manga_ocr - To read images from ShareX's screenshot folder, run in command line:
manga_ocr "/path/to/sharex/screenshot/folder"
Note that when running in the clipboard scanning mode, any image that you copy to clipboard will be processed by OCR and replaced by recognized text. If you want to be able to copy and paste images as usual, you should use the folder scanning mode instead and define a separate task in ShareX just for OCR, which saves screenshots to some folder without copying them to clipboard.
When running for the first time, downloading the model (~400 MB) might take a few minutes.
The OCR is ready to use after OCR ready message appears in the logs.
- To see other options, run in command line:
manga_ocr --help
If manga_ocr doesn't work, you might also try replacing it with python -m manga_ocr.
Usage tips
- OCR supports multi-line text, but the longer the text, the more likely some errors are to occur. If the recognition failed for some part of a longer text, you might try to run it on a smaller portion of the image.
- The model was trained specifically to handle manga well, but should do a decent job on other types of printed text, such as novels or video games. It probably won't be able to handle handwritten text though.
- The model always attempts to recognize some text on the image, even if there is none. Because it uses a transformer decoder (and therefore has some understanding of the Japanese language), it might even "dream up" some realistically looking sentences! This shouldn't be a problem for most use cases, but it might get improved in the next version.
Examples
Here are some cherry-picked examples showing the capability of the model.
| image | Manga OCR result |
|---|---|
![]() | 素直にあやまるしか |
![]() | 立川で見た〝穴〟の下の巨大な眼は: |
![]() | 実戦剣術も一流です |
![]() | 第30話重苦しい闇の奥で静かに呼吸づきながら |
![]() | よかったじゃないわよ!何逃げてるのよ!!早くあいつを退治してよ! |
![]() | ぎゃっ |
![]() | ピンポーーン |
![]() | LINK!私達7人の力でガノンの塔の結界をやぶります |
![]() | ファイアパンチ |
![]() | 少し黙っている |
![]() | わかるかな〜? |
![]() | 警察にも先生にも町中の人達に!! |
Contact
For any inquiries, please feel free to contact me at [email protected]
Acknowledgments
This project was done with the usage of:
- Manga109-s dataset
- CC-100 dataset











