# zyddnys/manga-image-translator

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/zyddnys-manga-image-translator).**

9,415 stars · 919 forks · Python · gpl-3.0

## Links

- GitHub: https://github.com/zyddnys/manga-image-translator
- Homepage: https://cotrans.touhou.ai/
- awesome-repositories: https://awesome-repositories.com/repository/zyddnys-manga-image-translator.md

## Topics

`anime` `auto-translation` `chinese-translation` `deep-learning` `image-processing` `inpainting` `japanese-translations` `machine-translation` `manga` `neural-network` `ocr` `pytorch-implementation` `text-detection` `text-detection-recognition` `transformer`

## Description

This project is an automated image translation system and pipeline specifically optimized for manga and comics. It provides a sequence of text detection, machine translation, and typesetting, and is available as an image translation API, a command-line tool for batch processing, and an LLM-powered translator.

The system utilizes OCR to detect text regions and an inpainter to remove original content by synthesizing background pixels. Translated text is then overlaid using an automated typesetter that manages font sizes, colors, and reading directions based on the original coordinates.

The workflow includes image upscaling to improve detection accuracy and a terminology management system using regular expression dictionaries and glossaries for text correction. Final outputs can be generated as multi-layered files that separate the original artwork, inpainted backgrounds, and translated text boxes.

## Tags

### Artificial Intelligence & ML

- [Image Text Translators](https://awesome-repositories.com/f/artificial-intelligence-ml/image-translation-pipelines/image-text-translators.md) — Detects text within images, removes original content, and overlays translated text while preserving visual style. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [Image Inpainting](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-pipelines/text-to-image-generators/image-inpainting.md) — Removes detected text and synthesizes background pixels based on surrounding image patterns using masks.
- [OCR-Driven Inpainting](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-pipelines/text-to-image-generators/image-inpainting/ocr-driven-inpainting.md) — Utilizes an inpainter to remove original manga text by synthesizing background pixels based on OCR detected regions.
- [Image Text Typesetting](https://awesome-repositories.com/f/artificial-intelligence-ml/image-text-typesetting.md) — Manages font size, alignment, color, and reading direction for translated text overlaid on images. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [Automated Typesetters](https://awesome-repositories.com/f/artificial-intelligence-ml/image-translation-pipelines/image-text-translators/automated-typesetters.md) — Provides an automated typesetter that manages font sizes, colors, and reading directions based on original text coordinates.
- [LLM Translation Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-translation-integrations.md) — Utilizes large language models and modular interfaces to perform context-aware translation of detected text.
- [Manga Translation Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-translation-integrations/manga-translation-pipelines.md) — Ships a specialized pipeline of text detection, machine translation, and typesetting optimized for manga and comic layouts.
- [Translation APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/image-translation-pipelines/image-text-translators/translation-apis.md) — Provides a web server with endpoints for programmatically submitting images for automated text detection and translation.

### Part of an Awesome List

- [Text Detection](https://awesome-repositories.com/f/awesome-lists/ai/text-detection.md) — Locates text regions within images using optical character recognition to define coordinates for processing.
- [Text Extraction and OCR](https://awesome-repositories.com/f/awesome-lists/more/text-extraction-and-ocr.md) — Extracts text from images and applies regex dictionaries to correct errors and maintain terminology.

### Development Tools & Productivity

- [Translation API Integrations](https://awesome-repositories.com/f/development-tools-productivity/translation-api-integrations.md) — Implements client-side integrations to connect with various online or local translation services. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [OCR Error Correction Dictionaries](https://awesome-repositories.com/f/development-tools-productivity/dictionary-and-translation-tools/ocr-error-correction-dictionaries.md) — Uses regular expression dictionaries to fix OCR errors and refine phrasing after translation. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [Layered Image Asset Exports](https://awesome-repositories.com/f/development-tools-productivity/project-export-environments/layered-image-asset-exports.md) — Generates files with separate layers for the original image, inpainted areas, and translated text boxes. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [Regex-Based Terminology Mapping](https://awesome-repositories.com/f/development-tools-productivity/technical-indexes/terminology-glossaries/regex-based-terminology-mapping.md) — Ensures consistent terminology by replacing specific words or phrases using regular expression dictionaries.

### User Interface & Experience

- [Visual Typesetting Workflows](https://awesome-repositories.com/f/user-interface-experience/layout-density-utilities/resolution-independent-engines/coordinate-grids/glyph-alignment-metrics/visual-typesetting-workflows.md) — Controls layout, fonts, and alignment of translated text to match the original visual style of comics.
- [Image Bounding Box Typesetting](https://awesome-repositories.com/f/user-interface-experience/text-coordinate-mapping/image-bounding-box-typesetting.md) — Calculates font sizes and alignment based on original bounding boxes to place translated text back into images.

### Software Engineering & Architecture

- [Translation](https://awesome-repositories.com/f/software-engineering-architecture/glossaries/translation.md) — Integrates custom terminology lists for proper nouns and character names to ensure consistency. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
- [Layer Stacks](https://awesome-repositories.com/f/software-engineering-architecture/non-destructive-editing-workflows/layer-stacks.md) — Constructs final images by stacking separate layers for original artwork, cleaned backgrounds, and new text.

### Web Development

- [Translation API Endpoints](https://awesome-repositories.com/f/web-development/translation-api-endpoints.md) — Provides a set of web server endpoints for programmatically submitting images for translation and retrieving results. ([source](https://cdn.jsdelivr.net/gh/zyddnys/manga-image-translator@main/README.md))
