Python, Automation, Data Science, Artificial Intelligence, Llm.
filename in os.listdir(image_directory): if filename.endswith('.jpg') or filename.endswith('.png'): # Open the image image_path = os.path.join(image_directory, filename) image = Image.open(image_path) # Create a drawing context draw = ImageDraw.Draw(image) # Calculate the position of the watermark