I need to batch create images with text. Requirements:
- arbitrary size of bitmap
- PNG format
- transparent background
- black text anti-aliased against transparency
- adjustable character spacing
- adjustable text position (x and y coordinates where text begins)
- TrueType and/or Type1 support
- Unix command line tool or Python library
So far I've evaluated the following:
- Python Imaging Library: fails 5.
- ImageMagick ("caption" option): hard to figure out 6.
- PyCairo: fails 5.
- SVG + ImageMagick convert: most promising, although requires multiple tools
The problem with PIL is that e.g. the default spacing for Verdana is way too sparse. I need the text to be a bit tighter, but there's no way to adjust it in PIL.
In ImageMagick I haven't found an easy way to specify where in the image the text begins (I'm using -size WIDTHxHEIGHT and caption:'TEXT'). Adding a transparent border will move the text away from the corner it's achored to, but
- image size needs to be adjusted accordingly since border adds to the extents
- it's not possible to adjust horizontal and vertical offset independently
Have I missed some obvious alternatives or failed to find necessary features from the above mentioned?