fax2tiff Command in Linux



The Linux fax2tiff command converts the fax files from raw fax data to TIFF. The fax2tiff command essentially creates a TIFF file from raw Group 3 and Group 4 encoded fax data directly obtained from the fax modem. Group 3 and Group 4 are compression standards for fax file transmission developed by ITU.

By default, the data is 1-dimensional encoded with 1728 pixels per row, producing low (98 lpi) or medium (196 lpi) resolution pages in a single strip, complying with the TIFF Class F specification.

Table of Contents

Here is a comprehensive guide to the options available with the fax2tiff command −

Prerequisites to Use fax2tiff Command

To ensure that the fax2tiff command is installed on Linux, use the following command −

which fax2tiff
Prerequisites to Use fax2tiff Command

If it shows a path to the fax2tiff command binary, then it is installed. If the above command does not produce any output, then install it using the instructions given below.

The fax2tiff command is a part of the libtiff-tools package on Linux.

To install the libtiff-tools package on Ubuntu, Kali Linux, Debian, and other Debian-based distributions, use the command given below −

sudo apt install libtiff-tools

To install it on Arch Linux, use the following command −

sudo pacman -S libtiff-tools

To install it on CentOS, use the following command −

sudo yum install libtiff-tools

To get the libtiff-tools package on Fedora, use the command given below −

sudo dnf install libtiff-tools

Syntax of fax2tiff Command

The syntax of the Linux fax2tiff command is as follows −

fax2tiff [options] [faxfile]

In the above syntax, the [options] field is used to specify the options used to modify the command's behavior. The [faxfile] field is used to mention files containing raw Group 3 and Group 4 encoded fax data.

fax2tiff Command Options

The options of the fax2tiff command are listed below.

Options that affect the input data are mentioned in the following table −

OptionsDescription
-3To assume the file is Group 3 encoded (default)
-4To assume the file Group 4 encoded
-UTo assume the specified files are with uncompressed data
-1To assume specified files containing data with the 1-dimensional version of Group 3
-2To assume specified files containing data with the 2-dimensional version of Group 3
-ATo assume the input data is not aligned with EOL (for Group 3 only)
-PTo assume the input data is aligned with EOL (for Group 3 only)
-MIt treats the input data as having bits filled fromthe Most Significant Bit (MSB) to the Least Significant Bit (LSB)
-LIt treats the input data as having bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB)
-BIt treats the data as encoded with black as 0 and white as 1
-WIt treats the data as encoded with black as 1 and white as 0 (default)
-RTo specify the vertical resolution in lines per inch of the input image (the default input is assumed to be 196 lines per inch)
-XTo specify the width in pixels of the input image (the default width is assumed to be 1728 pixels)

Options that affect the output data are mentioned in the following table −

OptionsDescription
-oTo specify the name of the file
-7To force the output to be encoded with Group 3 (default)
-8To force the output to be encoded with Group 4
-uTo force the output to be uncompressed
-5To force to output to be encoded with the 1-dimensional version of Group 3
-6To force to output to be encoded with the 2-dimensional version of Group 3 (default)
-aTo force the last bit of each End Of Line (EOL) code to land on a byte boundary (default)
-pTo not align the output with EOL (Group 3 only)
-cTo generate a classic Group 3 TIFF file format
-fTo generate the Class F (TIFF/F) file format (default)
-mTo force output to have bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB)
-lTo force output to have bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB) (default)
-rTo specify the number of rows in each strip of data written to the output file (By default, tiffcp limits rows per strip to 8 KB, except for G3/G4 compression, where specifying -1 or using G3/G4 compression creates one strip for the entire image)
-sTo stretch the input image vertically by writing input row twice to the output file
-vTo force the command to display the number of rows of data it receives from input file
-zTo force the output to be compressed with LZW encoding

Examples of fax2tiff Command in Linux

This section demonstrates the usage of the Linux fax2tiff command in Linux with examples −

  • Converting Fax File to TIFF
  • Converting Fax File to TIFF with a Specific Name
  • Converting Fax File to TIFF Assuming Input Data is Group 4 Encoded
  • Converting Fax File to an Uncompressed TIFF
  • Converting Fax File to TIFF with EOL Alignment
  • Converting Fax File to TIFF with Different Vertical Resolution
  • Converting Fax File to TIFF with Custom Width

Converting Fax File to TIFF

To convert a fax file to TIFF encoded using Group 3 compression, use the fax2tiff command in the following way −

fax2tiff input.fax
Converting Fax File to TIFF

The above command will generate a fax.tiff file in the current working directory.

Output in The Order Listed

Input files are treated as separate pages, appearing in the output in the order listed. Use the -c option for the classic format or -f for Class F.

Converting Fax File to TIFF with a Specific Name

The default output file is fax.tif, but it can be renamed using the -o option.

fax2tiff -o myfile.tiff input.fax

Converting Fax File to TIFF Assuming Input Data is Group 4 Encoded

To convert a Group 4 encoded file, use the fax2tiff command in the following way −

fax2tiff -4 -o myfile.tiff input.fax

Converting Fax File to an Uncompressed TIFF

To convert a fax file to an uncompressed TIFF file, use the -u option −

fax2tiff -u -o myfile.tiff input.fax

Converting Fax File to TIFF with EOL Alignment

To convert a fax file to TIFF with End Of Line (EOL) alignment, use the -A option −

fax2tiff -A -o myfile.tiff input.fax

For no EOL alignment, replace -A with the -p option in the above command.

Converting Fax File to TIFF with Different Vertical Resolution

The default vertical resolution of the fax2tiff command is 196 lines per inch. To convert a fax file to TIFF with a low resolution e.g. 98, use the -R option −

fax2tiff -R 98 -o myfile.tiff input.fax

Converting Fax File to TIFF with Custom Width

By default, the fax2tiff command converts the image with a width of 1728 pixels. To convert the fax file to TIFF with a custom width, use the -X option −

fax2tiff -X 1080 -o myfile.tiff input.fax

Conclusion

The fax2tiff command in Linux is used to convert fax files to TIFF image files, specifically Group 3 and Group 4 encoded. The TIFF is a widely accepted format compared to raw fax files. Moreover, the TIFF format enhances the usability, accessibility, and preservation of the information contained in faxed documents.

In this tutorial, we explained the fax2tiff command, its syntax, options, and usage in Linux with examples.