Last active
September 28, 2021 14:38
-
-
Save grampabacon/692965e9fea18f3fdd6005155d25e1bb to your computer and use it in GitHub Desktop.
create_cat_random_heart
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
from PIL import Image, ImageDraw | |
import pathlib | |
def create_cat_with_heart(id): | |
image = Image.open("Paper_Cat_Transparent.png") | |
path = "heart_cats/" | |
new_image = Image.new("RGB", image.size, get_background_colour()) | |
draw = ImageDraw.Draw(new_image) | |
draw.rectangle((400, 720, 700, 1000), fill=get_background_colour()) | |
new_image.paste(image, (0, 0), image) | |
pathlib.Path(path).mkdir(parents=True, exist_ok=True) | |
new_image.save(path + str(id) + ".png", "PNG") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment