Comments (10)
The only information available to the text renderer is the original text line positions, so if the original text is vertical and translated text is horizontal the rendered text will be too narrow.
You need a way to figure out where to put translated horizontal texts, which I can't figure out how to do.
As stated in README.md
:
5. Text rendering area is determined by detected text lines, not speech bubbles. This works for images without speech bubbles, but making it impossible to decide where to put translated English text. I have no idea how to solve this.
from manga-image-translator.
thanks for notifying me!
from manga-image-translator.
I has wrote a modification in the past year to this tool, that used the inpainting image to search the limit of the solid background color in the bubble and with that I was able to expand the text render area in a better way, well, I never pushed because I did in C# and called from python, isn't good for the project the way that I did it.
from manga-image-translator.
Here, I did with this code: https://gist.github.com/marcussacana/2e6bfa87ebb1a6b11eb41708125aba7d
And I called like this
import clr
clr.AddReference("TextDraw")
from TextDraw import GDI
GDI.DrawText('./result/render.png', trans_text, region.x, region.y, region.w, region.h, (255 << 24)|(region.fg_r << 16)|(region.fg_g << 8)|region.fg_b)
from manga-image-translator.
Here, I did with this code: https://gist.github.com/marcussacana/2e6bfa87ebb1a6b11eb41708125aba7d And I called like this
import clr clr.AddReference("TextDraw") from TextDraw import GDI GDI.DrawText('./result/render.png', trans_text, region.x, region.y, region.w, region.h, (255 << 24)|(region.fg_r << 16)|(region.fg_g << 8)|region.fg_b)
I had a little trouble rewriting it on the new version but it gave me more readable results even if I think it's mostly the way the text is rendered that changes.
I tested it only on English to another non-vertical language it will surely be less good from Japanese to English
This method (I forgot to remove the red rectangle)
from manga-image-translator.
Should change the font to be even better, that default one is very strange.
I don't know why, I remeber well to made this tools to try fill empty space much as possible, that red/blue squares are for that, to me debug the empty region that the tool found.
For some reason look like isn't working correctly, maybe I uploaded an outdated version of my code? lol
from manga-image-translator.
Ohh, maybe this:
very hard to see, but the image isn't really clean, this small detail stopped the text region to be expanded.
from manga-image-translator.
I don't think so, I tried with other ones that come from manga PLUS and it was always a bit the same
from manga-image-translator.
Only debugging then, maybe a bug, because I remember well that thing as one of the worst part writing that code.
from manga-image-translator.
Ohh, during the call you set the argument NoExpand
to true maybe?
from manga-image-translator.
Related Issues (20)
- [Feature Request]: support manga ocr HOT 1
- [Feature Request]: Vulkan alternative for radeon users
- 求助,翻译后图片残留原文字问题 HOT 1
- [Bug]: englishEnglish text detection don't work correctly HOT 1
- [Bug]: The translation of languages other than CJK is incomplete.
- [Bug]: Blur ramdom moments with no text
- [Feature Request]: OCR for English language HOT 4
- update model gpt4 HOT 3
- [Feature Request]: set up FROM which language to translate ONLY
- [Bug]: 在web模式下gui中无法正常上传原图 HOT 4
- [Feature Request]: how can i add any language?
- [Feature Request]: please Add KOR to deepl
- [Bug]: Output format PSD Error HOT 3
- [Feature Request]: run_as_kaggle
- 如何使用 HOT 1
- [Feature Request]: Store ocr images for lookup for performance
- May I know how to use deepl in python ? HOT 4
- [Feature Request]: please add translate to indonesia
- [Bug]: IndexError when rendered text has trailing space and text has only 2-3 symbols (like '? ' or '★ ')
- [Bug]: 使用Mac的Metal在OCR阶段会报错,识别出来的内容也不正确
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manga-image-translator.