I created this extension for personal use, but feel free to take this idea and improve upon it. The project was built entirely using ChatGPT, and while some of the code may be unnecessary, I decided to leave it as is for now. Future updates will refine and optimize the code further.
I have made two versions: 'Translate-image-manga-In-Page,' which is an extension that requires the Google API and comes with costs, and 'ghostmanga.py,' which is a script with a UI that's free and easy to use. The details are below. I created them because they share the same code structure but are used differently. I hope everyone will like them.
This Chrome extension finds the URLs of images on a page using a specified class, performs OCR (Optical Character Recognition) on those images, translates the text, and replaces the original images with new, translated versions.
Translate-image-manga-In-Page-main.zip
chrome://extensions/
Developer Mode
Load unpacked
Translate-image-manga-In-Page-main
Translate-image-manga-In-Page
folderchrome://extensions/
Below are common CSS selectors and their abbreviations, which the extension uses to find and manipulate images:
Full Form (HTML Attribute) | Abbreviation (CSS Selector) |
---|---|
[class="image-container"] |
.image-container |
[id="main-header"] |
#main-header |
[rel="stylesheet"] |
link[rel="stylesheet"] |
[href="https://example.com"] |
a[href="https://example.com"] |
[type="submit"] |
input[type="submit"] |
[role="navigation"] |
[role="navigation"] |
[data-toggle="dropdown"] |
[data-toggle="dropdown"] |
[alt="Image description"] |
img[alt="Image description"] |
[src^="https://"] |
img[src^="https://"] |
[name="email"] |
input[name="email"] |
[value="Search"] |
input[value="Search"] |
[class="image-container"] > img |
.image-container > img |
[class="button primary"] > span |
.button.primary > span |
div[class="content"] p |
div.content p |
[class="nav"] ul > li[class="nav-item"] |
.nav ul > li.nav-item |
[class="menu-item"] a:hover |
.menu-item a:hover |
[class="form-group"] input[type="text"] |
.form-group input[type="text"] |
[class="gallery"] div[class="gallery-item"] |
.gallery div.gallery-item |
If you want to search for all the images on the page, you can use the selector as just 'img', as shown in the image.
Ghost Manga UI v2.2.0 (This version still has a problem with slow program closing. I will fix it later.): https://www.mediafire.com/file/ftjnwukhpb4h0qx/Ghost_Manga_UI_v2.2.0.exe/file\ Ghost Manga UI All version: https://www.mediafire.com/folder/s6ecg0np9f6gj/Ghost+manga