|FAX2PNG(1)||System General Commands Manual||FAX2PNG(1)|
fax2png -- 1-bit multipage TIFF (fax or scan) to PNG image converter
fax2png tifffilename [pngfilename] [-p pagenumber] [-w width]
[-r 0|90|180|270] [-lr] [-tb] [-a]
fax2png fax.tiff page2.png -p 2 -w 600 -a
Version 1.0, 01/27/2004.
WHERE TO GET
.tar.gz file (just do "make", then "make install"):
download from our web server.
Extracts a specified page from a 1-bit black and white TIFF image, such as a fax, and efficiently converts it to PNG format without the performance overhead of netpbm-based solutions. Antialiasing is supported to produce attractive reductions to typical web browser widths, as in the example above. 90-degree-interval rotations and flips are also supported. While all of the above can be performed with netpbm and related utilities, fax2png is much more efficient in time and memory usage.
The input file must be in TIFF format, and must contain one or more single-bit images (black and white, such as a G3 fax file). Color images are not supported. If your TIFF files are not faxes or black and white document scans, you should use the slower but more general tifftopnm utility.
You may specify an output file name, such as myfile.png. If you do not specify a file name, a PNG format image is written to standard output.
You may indicate the desired page number with the -p option. Pages are numbered beginning with page 1. If you do not specify a page number, the first page is converted.
You may select the width of the output image with the -w option. If you do not specify the width, the width of the output will be the same as the width of the input. This is usually much too wide for typical applications. -w 600 -a is suggested for web browser display purposes. The height of the output image will be reduced by the same proportion.
You may specify rotation with the -r option. You may rotate by 0, 90, 180, or 270 degrees. If you do not use the -r option, no rotation is performed.
You may flip (mirror) the image from left to right by specifying the -lr option. Vertical flipping is accomplished using the -tb option.
When specifying the -w option to reduce size, it is almost always appropriate to also specify the -a option. When the -a option is used, the relevant input pixels are averaged to compute the value of the output pixel, producing high-quality output. Without -a, drastic size reductions (such as those necessary for onscreen display of faxes) are very unattractive.
fax2png does not process color TIFFs, grayscale TIFFs with more than two shades of grey (black and white), or any TIFF file that Leffler's TIFF Library cannot handle. That's why it is not called tiff2png.
Combining rotation and flipping in a single command line may produce counterintuitive results.
Copyright 2004, Boutell.Com, Inc. and Tobacco Documents Online. This software is released for free use under the terms of the GNU Public License, version 2 or higher. NO WARRANTY IS EXPRESSED OR IMPLIED. USE THIS SOFTWARE AT YOUR OWN RISK.
Thanks are due to Tobacco Documents Online for graciously allowing this work to be made available as open source following its completion for their use. Thanks are also due to Sam Leffler for his excellent TIFF library, as well as the authors of the PNG and ZLIB libraries.