Is there a canonical way in python to create a new image that fits exactly a given text in python? With pillow or something similar?
Like I would for example do with ImageMagick:
convert -font Calibri -pointsize 24 label:"Sample text with a foo bar attached to it." sample.png
Do I have to create an image of which I know it is oversized, draw the text and then crop it to image content?
1