python How to generate images of this type
I have a few lines and I need to generate this image
How do I realize this?
Answer 1, Authority 100%
Example of using the Pil
library
# import of the required modules
FROM PIL Import Image
From Pil Import ImageDraw
From Pil Import ImageFont
DEF Main ():
# Create a new image
image = image.New ('RGB', (300, 200), Color = ('Gray'))
# Object for drawing
Draw = ImageDraw.DRAW (Image)
# Load font
font = imagefont.trutype ("PT-SANS.TTF", 17)
# Draw text
Draw.Text ((0, 0), "Example for working with a library Pil", (0, 255, 255), font = font)
# Saving the image
image.save ('Example-Text.jpg')
# Show Image
image.show ()
if __name__ == '__main__':
Main ()