Skip to content

Instantly share code, notes, and snippets.

@hirocarma
Created August 30, 2024 15:27
Show Gist options
  • Save hirocarma/905ff9fcb19552ce45ecfe15e6977472 to your computer and use it in GitHub Desktop.
Save hirocarma/905ff9fcb19552ce45ecfe15e6977472 to your computer and use it in GitHub Desktop.
from PIL import Image, ImageDraw
height = 300
width = 600
txt_x = 2
txt_y = 2
txt_color = "red"
def color_save(text, color_rgb):
image = Image.new("RGB", (width, height), color=(color_rgb))
draw = ImageDraw.Draw(image)
draw.text((txt_x, txt_y), text, txt_color)
name = text + ".jpg"
image.save(name)
color_save("01", (244, 233, 227))
color_save("02", (247, 221, 111))
color_save("03", (75, 128, 253))
color_save("04", (151, 192, 171))
color_save("05", (247, 175, 119))
color_save("06", (216, 227, 151))
color_save("07", (131, 159, 155))
color_save("08", (169, 142, 94))
color_save("09", (252, 238, 191))
color_save("10", (249, 196, 124))
color_save("11", (244, 132, 85))
color_save("12", (233, 159, 124))
color_save("13", (128, 173, 231))
color_save("13", (128, 173, 231))
color_save("14", (153, 120, 80))
color_save("15", (124, 166, 104))
color_save("16", (66, 59, 77))
color_save("17", (221, 199, 253))
color_save("18", (254, 238, 246))
color_save("19", (51, 75, 92))
color_save("20", (160, 160, 148))
color_save("21", (15, 21, 52))
color_save("22", (245, 234, 200))
color_save("24", (221, 225, 227))
color_save("25", (94, 143, 159))
color_save("26", (75, 213, 232))
color_save("27", (210, 246, 253))
color_save("28", (255, 254, 244))
color_save("29", (234, 242, 247))
color_save("34", (255, 255, 255))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment