Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blopa/617740dcf9c52c0e62f9aeca011e4fc1 to your computer and use it in GitHub Desktop.
Save blopa/617740dcf9c52c0e62f9aeca011e4fc1 to your computer and use it in GitHub Desktop.
Code for post "Transforming manga pages for lazy western readers"
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