I am creating QRcode for each ticket. The QRcode is in image format.
image = Image.open('qrcode.jpg')
width, height = image.size
draw = ImageDraw.Draw(image)
text_cinema = "RPG Cinema"
text_seat = "Seat: 15C Balcony"
text_movie = "The baby boss"
text_showtime = "02:30 pm"
font = ImageFont.truetype('font.ttf', 24)
draw.text((40, 5), text_cinema, font=font)
draw.text((40,height - 40), text_seat, font=font)
draw.text((40,height + 40), text_movie, font=font)
draw.text((40,height + 40), text_showtime, font=font)
image.save(str(time()).replace('.', '_') + '.jpg')
And the image turns out to be in this way:
As you can see, the text are added into the image and not extending the image itself. Also, other data like text_movie, text_showtime and text_date are not being inserted as the text does not extend the image.
How can I extend the image and insert texts into the extended image area?