Download the PHP package hcharbonnier/mangatranslation without Composer
On this page you can find all versions of the php package hcharbonnier/mangatranslation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hcharbonnier/mangatranslation
More information about hcharbonnier/mangatranslation
Files in hcharbonnier/mangatranslation
Package mangatranslation
Short Description PHP manga automatic translator (Works with Google Cloud Platform)
License GPL-3.0-or-later
Informations about the package mangatranslation
mangatranslation
PHP manga automatic translator library (Works with Google Cloud Platform)
CPU Only, no cuda, no opencv, no local machine learning
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
If you want to test the library you can use the following example.php file or use the dedicated frontend : https://github.com/hcharbonnier/mangatranslation-frontend
Translation examples
Source
Translated
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
- Let me know
Installation
create a composer.json file in your project, and add:
then install depedencies:
Requirement
- php-7.4 (not tested with php<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.
(https://cloud.google.com/dataproc/docs/guides/setup-project)
- A free DeepL account if you prefer DeepL translation
Dev additionnal requirements
- php-7.4-xml
- php-7.4-xmlrpc
- php-7.4-mbstring
Example
example.php
Then run:
Extra features
Mangatranslation can be integrated with a custom frontend to perform better translation. This functions allow user to interact with the process:
Get list of textbox
Manually specify additional a textbox
Get translation of textbox $id_block
Get OCR of textbox $id_block
Manually specify translation
Manually specify cleaned raw image
All versions of mangatranslation with dependencies
ksubileau/color-thief-php Version ^1.4.1
google/cloud-translate Version ^1.7.1