View Full Version : Generate text images on Linux

03-05-2004, 11:37 AM
Hi. Say you want to generate a GIF image containing some text. Assuming you have the PBM package that may come with Linux, just do the following from shell in the directory where you'd like the image to reside.

prompt> echo "some text" | pbmtext | pnmcrop | pnmpad -white -l2 -r2 -t2 -b2 > sometext.pnm
prompt> convert sometext.pnm sometext.gif
prompt> rm sometext.pnm

This would produce the image shown here (http://www.phpdig.net/images/extra/sometext.gif).

Remember to remove any "word" wrapping in the above commands.