move and resize text

This commit is contained in:
Sarah 2022-04-29 16:35:42 +01:00
parent 8c79c57c58
commit 71402fb6b7
1 changed files with 6 additions and 1 deletions

View File

@ -41,7 +41,12 @@ def generate_map_timelapse(token_id, token_secret, filename):
img = Image.open(stream)
map_editable = ImageDraw.Draw(img)
map_editable.text((0, 0), "{}".format(date), (255, 64, 0))
# macos font path
font = ImageFont.truetype("/System/Library/Fonts/Supplemental/Arial.ttf", 48)
# image is 655 high
map_editable.text((2, 605), "{}".format(date), (255, 64, 0), font=font)
img_byte_arr = io.BytesIO()
img.save(img_byte_arr, format='PNG')