Last active
September 28, 2021 14:36
-
-
Save grampabacon/8cf8a791fec22ebe1c98b6ae4eef89e3 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 Paper Cat onto a random solid coloured background. | |
def create_cat(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "cats/" | |
new_image = Image.new("RGB", image.size, get_background_colour()) | |
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