Howdy!
What's the best command line option for converting a text file to a TIF? I have this...
-font Courier-New text:[file] -depth 8 -resize 200% -antialias [tif file]
What's weird is the the left part of the page looks okay while the right part of it looks.. well, as if the text is outlined rather than filled in.
So maybe I'm doing something wrong here? The text file should all fit on one page (any resizing option I can use to always ensure it does?) and it's just a slightly formatted (using spaces to align text) text file. Nothing special in it. I just want the TIFF file to be the text itself with no fancy effects.
I'd love it if there were some options that could also make sure the resulting TIF file was very readable.
Thanks!
Text file to TIFF
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Text file to TIFF
Prehaps you can post a link to a small example of what you get, verses what you expect.
You may also lok to look at the various text to image methods in
http://www.imagemagick.org/Usage/text/
Especially look at the pages "text:" file input codec
http://www.imagemagick.org/Usage/text/#text
Also as NewCourier is a Postscript font, chect that your ghostscript is installed and working correctly. You may like to look for some other Fixed Width font.
You may also lok to look at the various text to image methods in
http://www.imagemagick.org/Usage/text/
Especially look at the pages "text:" file input codec
http://www.imagemagick.org/Usage/text/#text
Also as NewCourier is a Postscript font, chect that your ghostscript is installed and working correctly. You may like to look for some other Fixed Width font.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Text file to TIFF
I worked with this a little bit and tried changing -depth 8 to -monochrome and that seemed to fix the problem. Before that I was also getting an error message on Windows Picture and Fax Viewer that said the picture was unreadable but using -monochrome fixed that and the problem with the half blurry page.
I appreciate the answer!
I appreciate the answer!
Re: Text file to TIFF
I have another question.
How do I take multiple text files and convert them all to tif as separate pages?
How do I take multiple text files and convert them all to tif as separate pages?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Text file to TIFF
Depends upon what you mean by converting text files to tiff.
You can do this:
convert textfile1.txt textfile2.txt textfile3.txt textfiles.tiff
this will make a tiff file with each textfile's text converted directly to tiff file with 3 frames/pages. But of course there will be no styling, coloring, pointsize, etc.
Is this what you want?
Or you can do something like:
convert -size 300x300 \
\( -fill red label:@textfile1.txt \) \
\( -fill green label:@textfile2.txt \) \
\( -fill blue label:@textfile3.txt \) textfiles.tiff
I don't know if there is a "best" way. Depends upon what you want to do. You can also use caption:, -draw, -annotate. See http://www.imagemagick.org/Usage/text/ for details on each and how to use them and parameters for each.
You can do this:
convert textfile1.txt textfile2.txt textfile3.txt textfiles.tiff
this will make a tiff file with each textfile's text converted directly to tiff file with 3 frames/pages. But of course there will be no styling, coloring, pointsize, etc.
Is this what you want?
Or you can do something like:
convert -size 300x300 \
\( -fill red label:@textfile1.txt \) \
\( -fill green label:@textfile2.txt \) \
\( -fill blue label:@textfile3.txt \) textfiles.tiff
I don't know if there is a "best" way. Depends upon what you want to do. You can also use caption:, -draw, -annotate. See http://www.imagemagick.org/Usage/text/ for details on each and how to use them and parameters for each.