Mangatan is a language-learning tool that creates Yomitan-scannable text overlays directly on top of manga served by Suwayomi.
For a streamlined application for reading and mining manga, anime, and novels on all platforms, check out: Manatan on GitHub.
tan.mp4
- The Reader: You open and read manga in your browser using Suwayomi.
- The Scanner: The Tampermonkey Userscript running in your browser detects when a page loads.
- The Process: The background server downloads the manga image, runs OCR on it, and sends back the text and coordinate data.
- The Overlay: The userscript turns this data into a matching, interactive text layer placed on top of the manga image, making it fully scannable with Yomitan.
To ensure dictionary lookups parse smoothly across line breaks and mining works correctly, adjust these settings in Yomitan:
- Replacement Patterns (under Translation settings):
- Add a pattern to replace
\nwith nothing. - Add a pattern to replace
\swith nothing.
- Add a pattern to replace
- Enable Character Search:
- Toggle on "Search text with non-Japanese, Chinese, or Korean characters". This allows Yomitan to correctly look up vocabulary that spans across line breaks containing hidden spaces or formatting characters.
- Sentence Termination:
- Go to
Text Parsing > Sentence termination charactersand change it to "Custom, no new lines" to prevent mined sentences from being cut short at line breaks.
- Go to
To enable compatibility with the Jiten Reader extension, configure the following settings:
Add the following JSON configuration under Parsing -> Extra Meta:
[
{
"host": "*://127.0.0.1:4567/manga/*",
"allFrames": true,
"parserClass": "manga-ocr-parser",
"parseVisibleObserver": true,
"addedObserver": {
"observeFrom": "body",
"checkNested": ".gemini-ocr-decoupled-overlay",
"notifyFor": ".gemini-ocr-text-box"
}
}
]Add the following styles under Appearance -> Advanced CSS Overrides -> Custom Word CSS:
/* 1. Force the entire text box to stay 100% transparent unless hovered or clicked */
.manga-ocr-parser .gemini-ocr-text-box:not(:hover):not(.manual-highlight) {
opacity: 0 !important;
}
/* 2. Only fix the layout when the text box is actively hovered or clicked */
.manga-ocr-parser .gemini-ocr-text-box:hover,
.manga-ocr-parser .gemini-ocr-text-box.manual-highlight {
display: block !important;
opacity: 1 !important;
}
/* 3. Force vertical text boxes to use proper Japanese Gothic fonts and a default mixed orientation */
.manga-ocr-parser .gemini-ocr-text-vertical {
text-orientation: mixed !important;
font-family: "Yu Gothic", "MS Gothic", "Meiryo", "Hiragino Kaku Gothic Pro", "Hiragino Sans", "Noto Sans JP", sans-serif !important;
}
/* 4. Force Jiten parsed words and punctuation to render upright (fixes single ? and !) */
.manga-ocr-parser .gemini-ocr-text-vertical .jiten-word {
text-orientation: upright !important;
} - Google Lens (Online): Cloud-based text recognition leveraging Google's OCR engine. Fast and accurate with no local model setup required, but depends on an active internet connection.
- Manga-OCR + Meiki Text Detection: Highly accurate local OCR. Models automatically download on first run.
- OneOCR with Preprocessing: Resizes images to 2500px wide, sharpens the source, performs OCR, and applies a Furigana filter to prevent dictionary selection errors.
- Editable Textboxes: Double-click any textbox to edit or correct OCR mistakes. Changes sync directly to the background server's local cache.
- Merging & Deleting: Hold your designated modifier keys (default:
Ctrlto merge,Altto delete) or use the mobile FAB menu to adjust box layouts. - Anki Image Export: Includes an active image picker to specify which page gets cropped during dual-page layouts.
- FAB Menu: Easily toggle between Edit, Merge, and Delete modes, or quick-trigger the Anki export.
Before configuring your background OCR server, set up the frontend:
- Suwayomi-Server
Set up and launch Suwayomi-Server. - Tampermonkey & Userscript
- Install the Tampermonkey browser extension.
- Go to your browser's extension settings for Tampermonkey and toggle "Allow access to file URLs" to enabled.
- Install the Mangatan userscript from this repository.
This option uses uv (a fast Python package manager) to install dependencies and run the background OCR server.
- Download or clone this repository to your local machine.
- Install
uvon your system. - Open a terminal, navigate into the
ocr-serverfolder, and launch your chosen processing engine:
| Processing Engine | Host System Requirements | Launch Command |
|---|---|---|
| Google Lens | Active Internet Connection | uv run server.py |
| OneOCR | Standard CPU | uv run server.py -e=oneocr |
| OneOCR (with Furigana Filter) | Standard CPU | uv run server.py -e=oneocrfurigana |
| Manga-OCR (CPU) | Standard CPU | uv run server.py -e=mangaocr |
| Manga-OCR-DirectML (Fast) | Windows GPU (NVIDIA, AMD, Intel) | uv run server.py -e=mangaocrdirectml |
Use this if you prefer running the background Google Lens OCR process via Node.js.
- Download or clone this repository to your local machine.
- Install Node.js on your computer.
- Open a terminal in the
ocr-server-legacydirectory and install the modules:npm ci
- Start the background server:
(Windows users can also double-click
node server.js
Runme.bat)
Use this if you prefer running local OCR (OneOCR) utilizing native Python packages.
- Download or clone this repository to your local machine.
- Ensure Python and OneOCR are installed.
- Open your terminal in the
ocr-server-legacydirectory and run:pip install oneocr waitress flask aiohttp Pillow "Flask[async]" - Start the server:
(Or launch
python local_server.py
runme(local-server).baton Windows) - Ensure the OCR Server URL in your Tampermonkey userscript settings (gear icon) is set to
http://127.0.0.1:3000.
Setting up node, Java, and background server processes inside Termux is complex, prone to performance issues, and resource-heavy on mobile hardware. If you are looking for a high-quality mobile reading experience, utilizing dedicated native apps is strongly recommended over this manual local server workflow:
- For Android: Use Chimahon (a specialized Mihon/Komikku immersion fork with native Yomitan dictionary lookup, Mokuro support, novel EPUB reader, and instant card mining).
- For Android & iOS: Use Manatan (the streamlined, cross-platform application for reading and language immersion on all platforms).
If you still prefer to host the background server and browser overlay setup manually on mobile, you can use the instructions below.
Runs both Suwayomi-Server and the background OCR server directly on your mobile device.
Recommended Browsers: Firefox or Edge Canary. Install Tampermonkey in the browser and add the userscript.
- Install Termux via F-Droid or GitHub Releases.
- Install Suwayomi-Server: Open Termux and run this installer command:
pkg update -y && pkg install -y openjdk-21 wget jq libandroid-posix-semaphore && mkdir -p ~/suwayomi/bin && LATEST_JAR_URL=$(curl -s https://api.github.com/repos/Suwayomi/Suwayomi-Server/releases/latest | jq -r '.assets[] | select(.name | endswith(".jar")) | .browser_download_url') && wget -O ~/suwayomi/SuwayomiServer.jar "$LATEST_JAR_URL" && echo -e '#!/data/data/com.termux/files/usr/bin/bash\njava -jar ~/suwayomi/SuwayomiServer.jar' > ~/suwayomi/bin/suwayomi && chmod +x ~/suwayomi/bin/suwayomi && echo 'export PATH="$HOME/suwayomi/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
- Install the OCR Server: Open a second Termux session/tab and run this command:
rm -rf ~/Mangatan && pkg install -y git nodejs && git clone https://github.com/kaihouguide/Mangatan && cd Mangatan/ocr-server-legacy && npm install express chrome-lens-ocr multer node-fetch --force && mkdir -p ~/bin && echo -e '#!/data/data/com.termux/files/usr/bin/sh\ncd ~/Mangatan/ocr-server-legacy && node server.js' > ~/bin/mangatan && chmod +x ~/bin/mangatan && echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc && source ~/.bashrc
- Configure Android WebAssembly Compatibility: Run these dependencies individually in your second Termux session:
npm install --cpu=wasm32 sharp --force
npm install @img/sharp-wasm32 --force
rm -rf node_modules package-lock.json
npm install --force
- Type
suwayomiin Termux Session 1. - Type
mangatanin Termux Session 2. - Open your mobile browser and navigate to
http://127.0.0.1:4567. - Controls: Long-press an image to hide or show the OCR overlay. Tap boxes to focus, and make use of the slide-out FAB menu to toggle edit/merge modes.
This allows hosting both Suwayomi-Server and the OCR Server on a powerful desktop while reading on a tablet or phone over your home Wi-Fi network.
- Host Configuration:
- Locate your Suwayomi
server.confdirectory:- Windows:
%LOCALAPPDATA%/Tachidesk - Linux:
~/.local/share/Tachidesk - macOS:
~/Library/Application Support/Tachidesk
- Windows:
- Open
server.confand changeserver.ipto match your desktop's local network IP address (e.g.,192.168.1.50). - Launch your desktop OCR server with the IP command argument:
node server.js --ip <your_desktop_ip>
- Locate your Suwayomi
- Mobile Configuration:
- Open the Tampermonkey dashboard on your mobile device.
- Edit the Mangatan script, replacing instances of
127.0.0.1orlocalhostwith your desktop's local IP address.
You can use NSSM (Non-Sucking Service Manager) to run both utilities in the background as services. Configure them using these batch file templates:
- Suwayomi Startup (
suwayomi_start.bat):@echo off cd /d "<path-to-suwayomi-server-folder>" "<path-to-suwayomi-server-folder>\jre\bin\java.exe" -jar "<path-to-suwayomi-server-folder>\bin\Suwayomi-Server.jar"
- OCR Startup (
ocr_start.bat):@echo off cd /d "<path-to-suwayomi-server-folder>\ocr-server-legacy" node server.js --cache-path "<your-cache-path>" --ip <your-ip-address> --port <your-port>
- The OCR server automatically creates and writes to
ocr-cache.jsonin its root folder to store text changes.