
Thread
2008.06.18 10:55 "Re: [Tiff] ascii to tiff conversion", by Gerben Vos
Hello - I have a need to create TIFF files from plain ascii text.
I'm not 100% sure what you mean, but I'll assume you want to create an image consisting of text displayed using some kind of font.
Off the top of my head, I can think of three ways; there are probably many more:
- Create a PNG image using the GD library and convert the resulting PNG to TIFF.
- Create a PBM image using pbmtext and convert the resulting PBM to TIFF using pnmtotiff.
- Write a program that uses GD to draw the text into an image buffer and then use libtiff to write a TIFF from that buffer. You may have to delve a bit into the GD internals to find out how to make this work. Or rip out the character-drawing code out of pbmtext and do the same with that.
I'm pretty sure that programs like ImageMagick and GraphicsMagick can do this too. The "montage" program with the "-draw" option looks promising. They can create TIFF directly.
GD: http://www.libgd.org/ pbmtext, pnmtotiff: http://netpbm.sourceforge.net/
Gerben Vos.