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)
- how to modify GoogleTranslator by using proxy
- 请问在哪里配置翻译服务(API key) Where can I configure the translation service (API key) HOT 1
- [Bug]: Api Mode error HOT 1
- [Bug]: Errors in api mode HOT 8
- [Bug]: We experienced an issue while translating your image. Error ID: not_found HOT 1
- [Bug]: TypeError: 'type' object is not subscriptable HOT 2
- [Feature Request]: Working on Mac HOT 16
- [Bug]: pydensecrf fails within mac m1 HOT 1
- [Bug]: Is it possible to avoid model download every docker run? HOT 1
- [Bug]: Segmentation Fault (Core Dumped) HOT 2
- [Bug]: pydensecrf link is broken
- How to use sakura model?
- [Bug]: Something went wrong, please try again HOT 1
- [Bug]: 求助:怎么配置翻译服务 HOT 1
- [Bug]: How to specify output file in demo mode? HOT 3
- [Development Issue] 试图引入Stariver(团子OCR)作为Detector与OCR工具,但输出时遇到了一些问题。
- [Feature Request]: Can we get support for Hindi Language (INDIA) and more website support
- [Bug]: 使用非标准翻译API翻译时,可能会导致输出图片文字空白 HOT 2
- [Bug]: pydenscerf is not working
- How to get only the OCR results?
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.