Last active
September 28, 2021 13:48
-
-
Save grampabacon/7c73d192ad3e43b3a0bca3849af4c0d6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import pathlib | |
from PIL import Image | |
# Layer the transparent cat onto a solid pink background image and save. | |
def create_cat(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "cats/" | |
new_image = Image.new("RGB", image.size, "PINK") | |
new_image.paste(image, (0, 0), image) | |
pathlib.Path(path).mkdir(parents=True, exist_ok=True) | |
new_image.save("cats/" + str(id) + ".png", "PNG") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment