Created
May 1, 2024 16:15
-
-
Save blopa/617740dcf9c52c0e62f9aeca011e4fc1 to your computer and use it in GitHub Desktop.
Code for post "Transforming manga pages for lazy western readers"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def do_task(base_image, final_output_image_path): | |
if isinstance(base_image, str): | |
base_image = Image.open(base_image) | |
extracted_text = extract_text_from_manga(base_image) | |
base_image = Image.open(base_image) if isinstance(base_image, str) else base_image | |
transparent_image = create_image_with_inverted_text_placement(base_image, extracted_text) | |
overlay_flipped_with_transparent(base_image, transparent_image, final_output_image_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment