move and resize text
This commit is contained in:
parent
8c79c57c58
commit
71402fb6b7
|
@ -41,7 +41,12 @@ def generate_map_timelapse(token_id, token_secret, filename):
|
||||||
img = Image.open(stream)
|
img = Image.open(stream)
|
||||||
|
|
||||||
map_editable = ImageDraw.Draw(img)
|
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_byte_arr = io.BytesIO()
|
||||||
img.save(img_byte_arr, format='PNG')
|
img.save(img_byte_arr, format='PNG')
|
||||||
|
|
Loading…
Reference in New Issue