Skip to content

Instantly share code, notes, and snippets.

@Ivoah
Last active July 22, 2016 21:56
Show Gist options
  • Save Ivoah/158aa9c7124f1d0c438a86e5a17c48f9 to your computer and use it in GitHub Desktop.
Save Ivoah/158aa9c7124f1d0c438a86e5a17c48f9 to your computer and use it in GitHub Desktop.
from PIL import Image, ImageDraw, ImageFont
baskerville = ImageFont.truetype('Baskerville.ttf', 72)
size = ImageDraw.Draw(Image.new('RGBA', (1, 1))).multiline_textsize('WorldviewAcademy\nForum', font = baskerville)
background = (240, 236, 224, 0)
col1 = (101, 76, 34)
col2 = (199,150,57)
img = Image.new('RGBA', size, background)
draw = ImageDraw.Draw(img)
draw.text((0, 0), 'WorldviewAcademy\nForum', col2, font = baskerville, align = 'right')
draw.rectangle(((0, 0), (img.size[0], img.size[1]/2 + 10)), background)
draw.rectangle(((img.size[0] - 75, img.size[1]/2), (img.size[0], img.size[1]/2 + 25)), background)
draw.text((0, 0), 'WorldviewAcademy', col1, font = baskerville, align = 'right')
img.save('wvlogo.png')
img.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment