Important
If you're sharing the translated result publicly and no experienced human translator participated in a throughout translating or proofreading, please mark it as machine translation somewhere clear to see.
简体中文 | English | pt-BR | Русский | 日本語 | Indonesia | Tiếng Việt
Yet another computer-aided comic/manga translation tool powered by deep learning.
preview
-
Fully automated translation
- Support automatic text-detection, recognition, removal, and translation. Overall performance is dependent upon these modules.
- Typesetting is based on the formatting estimation of the original text.
- Works decently with manga and comics.
- Improved manga->English, English->Chinese typesetting (based on the extraction of balloon regions.).
-
Image editing
- Support mask editing & inpainting (something like spot healing brush tool in PS)
- Adapted to images with extreme aspect ratio such as webtoons
-
Text editing
- Support rich text formatting and text style presets, translated texts can be edited interactively.
- Support search & replace
- Support export/import to/from word documents
If you don't want to install Python and Git by yourself and have access to the Internet:
Download BallonsTranslator_dev_src_with_gitpython.7z from MEGA or Google Drive, unzip it and run launch_win.bat.
Run scripts/local_gitpull.bat to get the latest update.
Install Python < 3.12 (dont use the one installed from microsoft store) and Git.
# Clone this repo
$ git clone https://github.com/dmMaze/BallonsTranslator.git ; cd BallonsTranslator
# Launch the app
$ python3 launch.py
Note the first time you launch it will install the required libraries and download models automatically. If the downloads fail, you will need to download the data folder (or missing files mentioned in the terminal) from MEGA or Google Drive and save it to the corresponding path in source code folder.
Note macOS can also run the source code if it didn't work.
- Download libs and models from MEGA or Google Drive
- Put all the downloaded resources into a folder called data, the final directory tree structure should look like:
data
├── libs
│ └── patchmatch_inpaint.dll
└── models
├── aot_inpainter.ckpt
├── comictextdetector.pt
├── comictextdetector.pt.onnx
├── lama_mpe.ckpt
├── manga-ocr-base
│ ├── README.md
│ ├── config.json
│ ├── preprocessor_config.json
│ ├── pytorch_model.bin
│ ├── special_tokens_map.json
│ ├── tokenizer_config.json
│ └── vocab.txt
├── mit32px_ocr.ckpt
├── mit48pxctc_ocr.ckpt
└── pkuseg
├── postag
│ ├── features.pkl
│ └── weights.npz
├── postag.zip
└── spacy_ontonotes
├── features.msgpack
└── weights.npz
7 directories, 23 files
- Install pyenv command line tool for managing Python versions. Recommend installing via Homebrew.
# Install via Homebrew
brew install pyenv
# Install via official script
curl https://pyenv.run | bash
# Set shell environment after install
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
# Enter the `data` working directory
cd data
# Clone the `dev` branch of the repo
git clone -b dev https://github.com/dmMaze/BallonsTranslator.git
# Enter the `BallonsTranslator` working directory
cd BallonsTranslator
# Run the build script, will ask for password at pyinstaller step, enter password and press enter
sh scripts/build-macos-app.sh
📌The packaged app is at ./data/BallonsTranslator/dist/BallonsTranslator.app, drag the app to macOS application folder to install. Ready to use out of box without extra Python config.
It is recommended to run the program in a terminal in case it crashed and left no information, see the following gif.
- The first time you run the application, please select the translator and set the source and target languages by clicking the settings icon.
- Open a folder containing images of a comic (manga/manhua/manhwa) that need translation by clicking the folder icon.
- Click the
Run
button and wait for the process to complete.
The font formats such as font size and color are determined by the program automatically in this process, you can predetermine those formats by change corresponding options from "decide by program" to "use global setting" in the config panel->Typesetting. (global settings are those formats shown by the right font format panel when you are not editing any textblock in the scene)
Image Editing Mode, Inpainting Tool
Rect Tool
To 'erase' unwanted inpainted results, use the inpainting tool or rect tool with your right button pressed.
The result depends on how accurately the algorithm ("method 1" and "method 2" in the gif) extracts the text mask. It could perform worse on complex text & background.
Text Editing Mode
Batch Text Formatting & Auto Layout
OCR & Translate Selected Area
A
/D
orpageUp
/Down
to turn the pageCtrl+Z
,Ctrl+Shift+Z
to undo/redo most operations. (note the undo stack will be cleared after you turn the page)T
to text-editting mode (or the "T" button on the bottom toolbar).W
to activate text block creating mode, then drag the mouse on the canvas with the right button clicked to add a new text block. (see the text editing gif)P
to image-editting mode.- In the image editing mode, use the slider on the right bottom to control the original image transparency.
- Disable or enable any automatic modules via titlebar->run, run with all modules disabled will re-letter and re-render all text according to corresponding settings.
- Set parameters of automatic modules in the config panel.
Ctrl++
/Ctrl+-
(AlsoCtrl+Shift+=
) to resize image.Ctrl+G
/Ctrl+F
to search globally/in current page.0-9
to adjust opacity of text layer- For text editing: bold -
Ctrl+B
, underline -Ctrl+U
, Italics -Ctrl+I
- Set text shadow and transparency in the text style panel -> Effect.
Alt+Arrow Keys
orAlt+WASD
(pageDown
orpageUp
while in text editing mode) to switch between text blocks.
python launch.py --headless --exec_dirs "[DIR_1],[DIR_2]..."
Note the configuration (source language, target language, inpaint model, etc) will load from config/config.json.
If the rendered font size is not right, specify logical DPI manually via --ldpi
, typical values are 96 and 72.
This project is heavily dependent upon manga-image-translator, online service and model training is not cheap, please consider to donate the project:
- Ko-fi: https://ko-fi.com/voilelabs
- Patreon: https://www.patreon.com/voilelabs
- 爱发电: https://afdian.net/@voilelabs
Sugoi translator is created by mingshiba.
-
Support English and Japanese text detection, training code and more details can be found at comic-text-detector
-
Support using text detection from Starriver Cloud (Tuanzi Manga OCR). Username and password need to be filled in, and automatic login will be performed each time the program is launched.
- For detailed instructions, see Tuanzi OCR Instructions: (Chinese & Brazilian Portuguese only)
- All mit* models are from manga-image-translator, support English, Japanese and Korean recognition and text color extraction.
- manga_ocr is from kha-white, text recognition for Japanese, with the main focus being Japanese manga.
- Support using OCR from Starriver Cloud (Tuanzi Manga OCR). Username and password need to be filled in, and automatic login will be performed each time the program is launched.
- The current implementation uses OCR on each textblock individually, resulting in slower speed and no significant improvement in accuracy. It is not recommended. If needed, please use the Tuanzi Detector instead.
- When using the Tuanzi Detector for text detection, it is recommended to set OCR to none_ocr to directly read the text, saving time and reducing the number of requests.
- For detailed instructions, see Tuanzi OCR Instructions: (Chinese & Brazilian Portuguese only)
- Added as an "optional" PaddleOCR module. In Debug mode you will see a message stating that it is not there. You can simply install it by following the instructions described there. If you don’t want to install the package yourself, just uncomment (remove the
#
) the lines with paddlepaddle(gpu) and paddleocr. Bet everything at your own peril andrisk. For me (bropines) and two testers, everything was installed fine, you may have an error. Write about it in issue and tag me.
- AOT is from manga-image-translator.
- All lama* are finetuned using LaMa
- PatchMatch is an algorithm from PyPatchMatch, this program uses a modified version by me.
Available translators: Google, DeepL, ChatGPT, Sugoi, Caiyun, Baidu. Papago, and Yandex.
- Google shuts down translate service in China, please set corresponding 'url' in config panel to *.com.
- Caiyun, ChatGPT, Yandex, Baidu, and DeepL translators needs to require a token or api key.
- DeepL & Sugoi translator (and it's CT2 Translation conversion) thanks to Snowad14.
- Sugoi translates Japanese to English completely offline. Download offline model, move "sugoi_translator" into the BallonsTranslator/ballontranslator/data/models.
- Sakura-13B-Galgame, check
low vram mode
in config panel if you're running it locally on a single device and encountered a crash due to vram OOM (enabled by default). - DeepLX: Please refer to Vercel or deeplx
- Added the Translators library, which supports access to some translator services without api keys. You can find out about supported services here.
- Supports two versions of OpenAI-compliant translators that work with official or third-party LLM providers compatible with the OpenAI API, requiring configuration in the settings panel.
- The non-suffix version consumes fewer tokens but has slightly weaker sentence splitting stability, which may cause issues with long text translations.
- The 'exp' suffix version uses more tokens, but has better stability and includes "jailbreaking" in the Prompt, making it suitable for long text translations.
For other good offline English translators, please refer to this thread.
To add a new translator, please reference how_to_add_new_translator, it is simple as subclass a BaseClass and implementing two interfaces, then you can use it in the application, you are welcome to contribute to the project.
- If your computer has an Nvidia GPU or Apple silicon, the program will enable hardware acceleration.
- Add support for saladict (All-in-one professional pop-up dictionary and page translator) in the mini menu on text selection. Installation guide
- Accelarate performance if you have a NVIDIA's CUDA or AMD's ROCm device as most modules uses PyTorch.
- Fonts are from your system's fonts.
- Thanks to bropines for the Russian localization.
- Added Export to photoshop JSX script by bropines.
To read the instructions, improve the code and just poke around to see how it works, you can go toscripts/export to photoshop
->install_manual.md
.