2008.06.17 10:49 "[Tiff] ascii to tiff conversion", by C R Granger

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:

  1. Create a PNG image using the GD library and convert the resulting PNG to TIFF.
  2. Create a PBM image using pbmtext and convert the resulting PBM to TIFF using pnmtotiff.
  3. 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.