the code bellow shows how to write text on image with creating a draw object
from PIL import Image, ImageFont, ImageDraw
image = Image.new(mode = "RGBA" , size= (500, 508) )
draw = ImageDraw.Draw(image)
font = ImageFont.load("arial.pil")
draw.text((10, 10), "hello", font=font)
what i'm asking for is how to return the text as a pillow object so i can just paste it on another images without having to create image object and draw object then writing text on them, i just want the raw text as a pillow object to use it later in .paste() function. something like (code doesn't exist but it's what i can imagine):
from PIL import Image, ImageFont, ImageDraw
image = Image.new(mode = "RGBA" , size= (500, 508) )
font = ImageFont.load("arial.pil")
text = font.loadtext("hello") #imaginary part (a pillow object)
image.paste(text, (10,10))