Skip to content

Instantly share code, notes, and snippets.

@zakx
Created June 3, 2016 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zakx/213f13def5510f8eea3454d5ab0556d0 to your computer and use it in GitHub Desktop.
Save zakx/213f13def5510f8eea3454d5ab0556d0 to your computer and use it in GitHub Desktop.
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("MesloLGSDZ-Regular.ttf", size=12)
for i in range(180, 254):
im = Image.new(mode="1", size=(i, i))
draw = ImageDraw.Draw(im)
draw.rectangle([0, 0, i, i], fill="black")
draw.text((50, 50), "i: {}".format(i), font=font, fill="white")
im.save("test{}.png".format(i), "PNG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment