VOOZH about

URL: https://www.geeksforgeeks.org/python/python-pil-imagedraw-draw-multiline_text/

⇱ Python PIL |ImageDraw.Draw.multiline_text() - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python PIL |ImageDraw.Draw.multiline_text()

Last Updated : 9 Sep, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use. ImageDraw.Draw.multiline_text() Draws the string at the given position.
Syntax: ImageDraw.Draw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=0, align="left") Parameters: xy – Top left corner of the text. text – Text to be drawn. fill – Color to use for the text. font – An ImageFont instance. spacing – The number of pixels between lines. align – If the text is passed on to multiline_text(), β€œleft”, β€œcenter” or β€œright”. Return Type:- returns an image with text.
Image Used: πŸ‘ Image
Code : Example of ImageDraw.Draw.multiline_text() Output: πŸ‘ Image
Another Example:Here we changing parameter. Image Used: πŸ‘ Image
Code : Example of ImageDraw.Draw.multiline_text()
Comment
Article Tags: