Giter VIP home page Giter VIP logo

Comments (10)

zyddnys avatar zyddnys commented on May 10, 2024

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.

ppkppk8520 avatar ppkppk8520 commented on May 10, 2024

thanks for notifying me!

from manga-image-translator.

marcussacana avatar marcussacana commented on May 10, 2024

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.

marcussacana avatar marcussacana commented on May 10, 2024

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)

the output has like this:
image

from manga-image-translator.

Snowad14 avatar Snowad14 commented on May 10, 2024

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)

the output has like this: image

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

Normal :
Normal

Manga2eng :
MangaENG

This method (I forgot to remove the red rectangle)
New

from manga-image-translator.

marcussacana avatar marcussacana commented on May 10, 2024

Should change the font to be even better, that default one is very strange.
image
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.

marcussacana avatar marcussacana commented on May 10, 2024

Ohh, maybe this:
image
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.

Snowad14 avatar Snowad14 commented on May 10, 2024

I don't think so, I tried with other ones that come from manga PLUS and it was always a bit the same
inpainted

from manga-image-translator.

marcussacana avatar marcussacana commented on May 10, 2024

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.

marcussacana avatar marcussacana commented on May 10, 2024

Ohh, during the call you set the argument NoExpand to true maybe?

from manga-image-translator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.