Created
June 3, 2016 20:51
-
-
Save zakx/213f13def5510f8eea3454d5ab0556d0 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
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