# omarleel/mangatranslate architecture

> Architecture diagram of the GitHub repository omarleel/mangatranslate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omarleel/mangatranslate
- Repository: https://github.com/omarleel/mangatranslate

## Overview

MangaTranslate is a manga-page cleanup and translation application. In the Windows workflow, a user configures processing in the GUI, which starts a processor that handles image folders and produces cleaned and/or translated pages, with PDF and structured JSON export. The Colab variant adds parallel processing and Google Drive folder handling. The README also documents ZIP input, OCR, inpainting, and output organization. Some subsystem links rely on the SOURCE INDEX or README; unsampled implementation details are not assumed.

Main entry points: [`Applications/ProcessorWindows.py`](https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorWindows.py) (Windows processor), [`Applications/ProcessorColab.py`](https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorColab.py) (Colab processor), [`Applications/inpainting/lama/inference.py`](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/inference.py) (Model inference), [`Applications/Utilities.py`](https://github.com/omarleel/mangatranslate/blob/master/Applications/Utilities.py) (Translation and utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_desktop["Windows GUI<br/>[AppWindow.py]"]
  node_colabui["Colab UI<br/>[AppColab.py]"]
end

subgraph group_workflow["Processing workflow"]
  node_winprocessor["Windows processor"]
  node_colabprocessor["Colab processor<br/>[ProcessorColab.py]"]
  node_parallel["Parallel processing"]
  node_utilities["Translation and utilities<br/>[Utilities.py]"]
  node_constants["Paths and settings<br/>[Constantes.py]"]
end

subgraph group_vision["Image and text processing"]
  node_ocr["OCR engines<br/>[OCRManager.py]"]
  node_bubbles["Bubble detection<br/>[BubbleDetector.py]"]
  node_imageops["Image and text rendering"]
  node_lama["LaMa inpainting"]
  node_lama_inference["Model inference<br/>[inference.py]"]
  node_lama_generic["Inpainting utilities<br/>[generic.py]"]
  node_lama_common["Model helpers<br/>[common.py]"]
  node_lama_log["Inference logging<br/>[log.py]"]
end

subgraph group_outputs["Exports and storage"]
  node_json["JSON export<br/>[JsonGenerator.py]"]
  node_txt["Text export<br/>[TxtGenerator.py]"]
  node_files["Local file manager<br/>[FileManager.py]"]
end

subgraph group_colab["Colab integrations"]
  node_drive["Google Drive manager"]
end

node_user(("Manga user"))
node_gdrive[("Google Drive")]
node_images["Image folder"]
node_outputs_store[("Outputs folder")]

node_user -->|"configures"| node_desktop
node_desktop -->|"starts processing"| node_winprocessor
node_winprocessor -->|"recognizes text"| node_ocr
node_winprocessor -->|"detects bubbles"| node_bubbles
node_winprocessor -->|"processes pages"| node_imageops
node_imageops -->|"inpaints"| node_lama
node_lama -.->|"uses inference"| node_lama_inference
node_lama_inference -->|"uses utilities"| node_lama_generic
node_lama_inference -->|"uses logging"| node_lama_log
node_lama_common -->|"supports inference"| node_lama_inference
node_winprocessor -->|"uses utilities"| node_utilities
node_winprocessor -->|"writes transcription"| node_json
node_colabprocessor -->|"writes JSON"| node_json
node_colabprocessor -->|"writes text"| node_txt
node_winprocessor -->|"creates output folders"| node_files
node_winprocessor -.->|"reads pages"| node_images
node_winprocessor -.->|"stores results"| node_outputs_store
node_colabui -.->|"starts processing"| node_colabprocessor
node_colabprocessor -->|"uses parallel processing"| node_parallel
node_colabprocessor -->|"processes pages"| node_imageops
node_colabprocessor -->|"recognizes text"| node_ocr
node_colabprocessor -->|"detects bubbles"| node_bubbles
node_colabprocessor -->|"manages Drive folders"| node_drive
node_drive -->|"downloads and uploads"| node_gdrive
node_colabui -->|"downloads ZIP input"| node_utilities
node_utilities -->|"downloads model assets"| node_gdrive
node_winprocessor -->|"uses configured paths"| node_constants
node_colabprocessor -->|"uses configured paths"| node_constants

click node_desktop "https://github.com/omarleel/mangatranslate/blob/master/Widgets/AppWindow.py"
click node_colabui "https://github.com/omarleel/mangatranslate/blob/master/Widgets/AppColab.py"
click node_winprocessor "https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorWindows.py"
click node_colabprocessor "https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorColab.py"
click node_parallel "https://github.com/omarleel/mangatranslate/blob/master/Applications/ParallelProcessor.py"
click node_ocr "https://github.com/omarleel/mangatranslate/blob/master/Applications/OCRManager.py"
click node_bubbles "https://github.com/omarleel/mangatranslate/blob/master/Applications/BubbleDetector.py"
click node_imageops "https://github.com/omarleel/mangatranslate/blob/master/Applications/TextImageProcessor.py"
click node_lama "https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/inpainting_lama_mpe.py"
click node_lama_inference "https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/inference.py"
click node_lama_generic "https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/generic.py"
click node_lama_common "https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/common.py"
click node_lama_log "https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/log.py"
click node_utilities "https://github.com/omarleel/mangatranslate/blob/master/Applications/Utilities.py"
click node_json "https://github.com/omarleel/mangatranslate/blob/master/Applications/JsonGenerator.py"
click node_txt "https://github.com/omarleel/mangatranslate/blob/master/Applications/TxtGenerator.py"
click node_files "https://github.com/omarleel/mangatranslate/blob/master/Applications/FileManager.py"
click node_constants "https://github.com/omarleel/mangatranslate/blob/master/Utils/Constantes.py"
click node_drive "https://github.com/omarleel/mangatranslate/blob/master/Applications/GoogleDriveManager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop,node_colabui,node_user toneBlue
class node_winprocessor,node_colabprocessor,node_parallel,node_utilities,node_constants,node_gdrive,node_outputs_store toneAmber
class node_ocr,node_bubbles,node_imageops,node_lama,node_lama_inference,node_lama_generic,node_lama_common,node_lama_log toneMint
class node_json,node_txt,node_files toneRose
class node_drive,node_images toneIndigo
```

## Components

### User interfaces

- [Windows GUI](https://github.com/omarleel/mangatranslate/blob/master/Widgets/AppWindow.py): `Widgets/AppWindow.py`
- [Colab UI](https://github.com/omarleel/mangatranslate/blob/master/Widgets/AppColab.py): `Widgets/AppColab.py`

### Processing workflow

- [Windows processor](https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorWindows.py): `Applications/ProcessorWindows.py`
- [Colab processor](https://github.com/omarleel/mangatranslate/blob/master/Applications/ProcessorColab.py): `Applications/ProcessorColab.py`
- [Parallel processing](https://github.com/omarleel/mangatranslate/blob/master/Applications/ParallelProcessor.py): `Applications/ParallelProcessor.py`
- [Translation and utilities](https://github.com/omarleel/mangatranslate/blob/master/Applications/Utilities.py): `Applications/Utilities.py`
- [Paths and settings](https://github.com/omarleel/mangatranslate/blob/master/Utils/Constantes.py): `Utils/Constantes.py`

### Image and text processing

- [OCR engines](https://github.com/omarleel/mangatranslate/blob/master/Applications/OCRManager.py): `Applications/OCRManager.py`
- [Bubble detection](https://github.com/omarleel/mangatranslate/blob/master/Applications/BubbleDetector.py): `Applications/BubbleDetector.py`
- [Image and text rendering](https://github.com/omarleel/mangatranslate/blob/master/Applications/TextImageProcessor.py): `Applications/TextImageProcessor.py`
- [LaMa inpainting](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/inpainting_lama_mpe.py): `Applications/inpainting/lama/inpainting_lama_mpe.py`
- [Model inference](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/inference.py): `Applications/inpainting/lama/inference.py`
- [Inpainting utilities](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/generic.py): `Applications/inpainting/lama/generic.py`
- [Model helpers](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/common.py): `Applications/inpainting/lama/common.py`
- [Inference logging](https://github.com/omarleel/mangatranslate/blob/master/Applications/inpainting/lama/log.py): `Applications/inpainting/lama/log.py`

### Exports and storage

- [JSON export](https://github.com/omarleel/mangatranslate/blob/master/Applications/JsonGenerator.py): `Applications/JsonGenerator.py`
- [Text export](https://github.com/omarleel/mangatranslate/blob/master/Applications/TxtGenerator.py): `Applications/TxtGenerator.py`
- [Local file manager](https://github.com/omarleel/mangatranslate/blob/master/Applications/FileManager.py): `Applications/FileManager.py`

### Colab integrations

- [Google Drive manager](https://github.com/omarleel/mangatranslate/blob/master/Applications/GoogleDriveManager.py): `Applications/GoogleDriveManager.py`

### Other components

- **Manga user**
- **Google Drive**
- **Image folder**
- **Outputs folder**

## Connections

- Manga user → Windows GUI: configures (evidence: `Widgets/AppWindow.py`)
- Windows GUI → Windows processor: starts processing (evidence: `Widgets/AppWindow.py`)
- Windows processor → OCR engines: recognizes text (evidence: `Applications/ProcessorWindows.py`)
- Windows processor → Bubble detection: detects bubbles (evidence: `Applications/ProcessorWindows.py`)
- Windows processor → Image and text rendering: processes pages (evidence: `Applications/ProcessorWindows.py`)
- Image and text rendering → LaMa inpainting: inpaints (evidence: `Applications/TextImageProcessor.py`)
- LaMa inpainting → Model inference: uses inference
- Model inference → Inpainting utilities: uses utilities (evidence: `Applications/inpainting/lama/inference.py`)
- Model inference → Inference logging: uses logging (evidence: `Applications/inpainting/lama/inference.py`)
- Model helpers → Model inference: supports inference (evidence: `Applications/inpainting/lama/common.py`)
- Windows processor → Translation and utilities: uses utilities (evidence: `Applications/ProcessorWindows.py`)
- Windows processor → JSON export: writes transcription (evidence: `Applications/ProcessorWindows.py`)
- Colab processor → JSON export: writes JSON (evidence: `Applications/ProcessorColab.py`)
- Colab processor → Text export: writes text (evidence: `Applications/ProcessorColab.py`)
- Windows processor → Local file manager: creates output folders (evidence: `Applications/ProcessorWindows.py`)
- Windows processor → Image folder: reads pages
- Windows processor → Outputs folder: stores results
- Colab UI → Colab processor: starts processing (evidence: `Widgets/AppColab.py`)
- Colab processor → Parallel processing: uses parallel processing (evidence: `Applications/ProcessorColab.py`)
- Colab processor → Image and text rendering: processes pages (evidence: `Applications/ProcessorColab.py`)
- Colab processor → OCR engines: recognizes text (evidence: `Applications/ProcessorColab.py`)
- Colab processor → Bubble detection: detects bubbles (evidence: `Applications/ProcessorColab.py`)
- Colab processor → Google Drive manager: manages Drive folders (evidence: `Applications/ProcessorColab.py`)
- Google Drive manager → Google Drive: downloads and uploads (evidence: `Applications/GoogleDriveManager.py`)
- Colab UI → Translation and utilities: downloads ZIP input (evidence: `Widgets/AppColab.py`)
- Translation and utilities → Google Drive: downloads model assets (evidence: `Applications/Utilities.py`)
- Windows processor → Paths and settings: uses configured paths (evidence: `Applications/ProcessorWindows.py`)
- Colab processor → Paths and settings: uses configured paths (evidence: `Applications/ProcessorColab.py`)
