Untitled
unknown
plain_text
a year ago
980 B
10
Indexable
from PIL import Image, ImageDraw, ImageFont # Load the image image_path = "/mnt/data/2fe26736-e8db-429c-9fd6-401a7e3e.png" image = Image.open(image_path) # Define the new text new_text = """\ Congratulations Ralph Sloka! We are thrilled to inform you that you have been accepted into the Call of Duty competition. Your skills and dedication have not gone unnoticed, and we are excited to see you in action. """ # Load a font font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf" font = ImageFont.truetype(font_path, 18) # Create a drawing context draw = ImageDraw.Draw(image) # Define text position text_position = (20, 100) # Define text color text_color = (255, 255, 255) # Add the new text to the image draw.text(text_position, new_text, font=font, fill=text_color) # Save the edited image edited_image_path = "/mnt/data/edited_image.png" image.save(edited_image_path) # Display the edited image path edited_image_path
Editor is loading...
Leave a Comment