I am trying to draw the text 'we made it' onto an imported gif and display it on my notebook:
my_image = Image(url = 'https://miro.medium.com/max/1000/1*AmI9wRbXrfIWGESx6eEiTw.gif')
image_editable = ImageDraw.Draw(my_image)
image_editable.text((15,15), "We made it", (237, 230, 211), font=title_font)
my_image.show()
But I am getting the error:
AttributeError Traceback (most recent call last)
~\anaconda3\lib\site-packages\PIL\ImageDraw.py in Draw(im, mode)
767 try:
--> 768 return im.getdraw(mode)
769 except AttributeError:
AttributeError: 'Image' object has no attribute 'getdraw'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_17400/3060345407.py in <module>
1 my_image = Image(url = 'https://miro.medium.com/max/1000/1*AmI9wRbXrfIWGESx6eEiTw.gif')
2
----> 3 image_editable = ImageDraw.Draw(my_image)
4 image_editable.text((15,15), "We made it", (237, 230, 211), font=title_font)
5 my_image.show()
~\anaconda3\lib\site-packages\PIL\ImageDraw.py in Draw(im, mode)
768 return im.getdraw(mode)
769 except AttributeError:
--> 770 return ImageDraw(im, mode)
771
772
~\anaconda3\lib\site-packages\PIL\ImageDraw.py in __init__(self, im, mode)
56 defaults to the mode of the image.
57 """
---> 58 im.load()
59 if im.readonly:
60 im._copy() # make it writeable
AttributeError: 'Image' object has no attribute 'load'
How can I get rid of these errors?