As I write this, 25 threads include mention of Mokuro. Of those, 16 mentions were by me, and one was an offshoot of one of my mentions.
I’ve considered adding Mokuro to the Ultimate Additional Japanese Resources List, but including Mokuro as part of a larger process leads to unlimited potential.
Note: I didn’t write Mokuro. Full credit goes to Maciej Budyś. I’m just a happy customer of this free software and use it every day.
Mokuro
History
History of OCR and Mokuro
Tools like Yomichan and Migaku can hook into text for quick look-ups. Although designed for use on web pages, in some circumstances, one can utilize such tools for digital novels, digital light novels, visual novels and video games, and video subtitles.
Manga has traditionally been excluded from this list because its text is embedded in image files.
Text in images can only be read through a process called optical character recognition (OCR). However, even Google’s Tesseract OCR has difficulty when given clear text images. Traditional OCR tools fail miserably when it comes to manga, with its various fonts, font sizes, small-resolution images for older releases, and other situations.
Enter a developer named Maciej Budyś. In January 2022, Budyś released code for a project called Manga OCR.
What makes this tool different from prior OCR applications? The software’s README document speaks for itself:
Between this application to OCR text, and an unrelated project called Comic Text Detector to isolate the text to run through OCR, I was able to start building a workflow to utilize manga in my Japanese learning journey better.
However, I didn’t have a good process for these tools. I needed a more cohesive tool.
Less than four months later, Budyś released a tool that does just that: Mokuro.
What does Mokuro do?
Mokuro takes in manga images and returns an HTML file. This HTML file allows one to navigate through the manga pages and select text. This allows using tools such as Yomichan and Migaku to look up words while reading digital manga.
Requirements
Python
Mokuro is written in Python, meaning it can be installed and run on any system that supports Python, including Linux, Windows, and Mac. In some cases, it can be installed via pip, Python’s package installer.
Digital Manga
This is the more difficult part because any manga sold digitally includes digital rights management (DRM), which prevents you from being able to run the manga images through Mokuro.
By using tools (that I probably can’t link to here), one can get around the DRM on the manga they bought from Amazon, Kobo, or Bookwalker. This allows accessing the images for one’s personal use.
Usage
Mokuro’s GitHub repository (linked at the top of this post) includes instructions on how to use the software.
Feeding a folder of manga pages into Mokuro results in an HTML file with selectable text.
Text Parser Dictionaries
On Chrome and other Chromium-based web browsers, text parsers such as Yomitan and Migaku won’t work with local Mokuro files until you enable the extension’s “Allow access to file URLs” option.
For me, the magic is in the potential.
This comes in two forms.
First, Mokuro stores its parsed information in JSON files. This allows developers like myself to write software that taps into and utilizes these files.
I know I’m not the only one here using Mokuro. For this reason, I wanted a place where I could mention the various projects I’ve used Mokuro for. And, if there is interest, try to make them available for others to use.
Projects
I’ll post each project below and link to them from here.
- Mokuro Bookshelf
- Mokuro Sentences Extract
- Mokuro Text Search (Ruby implementation)
- Java Implementation
- Python implementation (recommended over the Ruby implementation)
If you have any Mokuro-based projects that are available for others to use, or that you would consider making available if there’s interest, post about them below and I’ll include them in the list.