Last active
March 12, 2023 06:41
-
-
Save pekochan069/4638c58683b64b91c0595898357775e7 to your computer and use it in GitHub Desktop.
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
# pip install Pillow | |
from PIL import Image | |
tags = "1girl, solo, pink hair, blue eyes, short hair, looking at viewer, long sleeves, closed mouth, bangs, hair between eyes, breasts, jacket, shirt, looking back, black shirt, medium breasts" | |
formatted_tags = tags.replace(", ", ";") | |
image = Image.open("1.png") | |
exif = image.getexif() | |
exif[0x9C9E] = formatted_tags.encode("utf-16") | |
image.save("2.png", exif=exif) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment