Skip to content

Instantly share code, notes, and snippets.

@jmrnilsson
Created May 14, 2019 21:16
Show Gist options
  • Save jmrnilsson/1928a44ee280bcb72f604a4c3c8857cf to your computer and use it in GitHub Desktop.
Save jmrnilsson/1928a44ee280bcb72f604a4c3c8857cf to your computer and use it in GitHub Desktop.
Generate emojis for agile estimation and planning polls
from PIL import Image, ImageDraw, ImageFont
# https://get.slack.help/hc/en-us/articles/206870177-Add-custom-emoji
estimations = ['1h', '2h', '4h', '6h', '1d', '2d', '3d', '4d', '1w', '2w', 'inf']
fnt_ = ImageFont.truetype('C:\\WINDOWS\\FONTS\\CONSOLA.ttf', 96)
for e in estimations:
fnt = fnt_ if len(e) < 3 else ImageFont.truetype('C:\\WINDOWS\\FONTS\\CONSOLA.ttf', 65)
img = Image.new('RGB', (128, 128), color = (73, 109, 137))
d = ImageDraw.Draw(img)
d.text((10,28), e, font=fnt, fill=(255,255,255))
img.save('e%s.png' % e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment