Created
May 14, 2019 21:16
-
-
Save jmrnilsson/1928a44ee280bcb72f604a4c3c8857cf to your computer and use it in GitHub Desktop.
Generate emojis for agile estimation and planning polls
This file contains 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 | |
# 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) | |
This file contains 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
Pillow==6.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment