PHPackages                             hcharbonnier/mangatranslation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hcharbonnier/mangatranslation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hcharbonnier/mangatranslation
=============================

PHP manga automatic translator (Works with Google Cloud Platform)

1.3.0(4y ago)743GPL-3.0-or-laterPHPCI failing

Since Mar 21Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/hcharbonnier/mangatranslation)[ Packagist](https://packagist.org/packages/hcharbonnier/mangatranslation)[ RSS](/packages/hcharbonnier-mangatranslation/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (5)Versions (20)Used By (0)

mangatranslation
================

[](#mangatranslation)

PHP manga automatic translator library (Works with Google Cloud Platform)

CPU Only, no cuda, no opencv, no local machine learning

Warning
-------

[](#warning)

- I am not a dev, this project work well, but the code quality is probably shi...
- In order to get acceptable result, your manga/comic raw quality has to be near perfect!!
- Google translate work well when translated from chinese(manhua), but not so well from Japanese(Manga)

Frontend
--------

[](#frontend)

If you want to test the library you can use the following example.php file or use the dedicated frontend :

Translation examples
--------------------

[](#translation-examples)

### Source

[](#source)

[![Source](images/0004.jpg "Source")](images/0004.jpg)

### Translated

[](#translated)

[![Translated](images/0004-translated.jpg "Translated")](images/0004-translated.jpg)

Workflow summary
----------------

[](#workflow-summary)

- Open image (jpeg, png, gif or bmp)
- Detect textboxes
- Detect font size
- OCR Text in textboxes
- Remove old text from textboxes
- Check in sqliteDB if we already know the translation for the current string
- Use Google API to translate (or free Deepl API)
- Expand textboxes if possible
- Adapt translation font size to fit in textboxes
- write translation in the corresponding textboxes
- export image

Known Issues
------------

[](#known-issues)

- Let me know

Installation
------------

[](#installation)

create a composer.json file in your project, and add:

```
{
    "minimum-stability": "dev",
    "require": {
         "hcharbonnier/mangatranslation": ">=1.3.0"
    }
}
```

then install depedencies:

```
composer install
mkdir uploads
```

Requirement
-----------

[](#requirement)

- php-7.4 (not tested with php&lt;7.4 but could work)
- php-gd
- php-openssl
- php-bcmath
- php-curl
- php-sqlite3
- A google cloud platform project configured with translate and vision enable. ()
- A free DeepL account if you prefer DeepL translation

Dev additionnal requirements
----------------------------

[](#dev-additionnal-requirements)

- php-7.4-xml
- php-7.4-xmlrpc
- php-7.4-mbstring

Example
-------

[](#example)

example.php

```
