Insert Text into an image in Google Colab using Python.
************************** +Code+ **************************
from PIL import Image, ImageDraw, ImageFont
img = Image.open('/content/drive/MyDrive/images/taifun.png')
display(img)
d = ImageDraw.Draw(img)
fnt = ImageFont.truetype(r'/usr/share/fonts/truetype/ttf-liberation/LiberationSansNarrow-Regular.ttf',100)
fntsmall = ImageFont.truetype(r'/usr/share/fonts/truetype/humor-sans/Humor-Sans.ttf',50)
d.text((100,50),"Taifun", font=fnt, fill=(255,255,255))
d.text((10,160),"This was a big one", font=fntsmall, fill=(255,255,255))
img.save('/content/drive/MyDrive/images/newpic.png')
newimg = Image.open('/content/drive/MyDrive/images/newpic.png')
display(newimg)
En esta página del sitio puede ver el video en línea Insert Text into Image using Python de Duración hora minuto segunda en buena calidad , que subió el usuario Python Peter 16 agosto 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 55 veces y le gustó 1 a los espectadores. Disfruta viendo!