| 1 |
fax2tiff |
| 2 |
======== |
| 3 |
|
| 4 |
.. program:: fax2tiff |
| 5 |
|
| 6 |
Synopsis |
| 7 |
-------- |
| 8 |
|
| 9 |
**fax2tiff** [ *options* ] [ **-o** *output.tif* ] *input.raw* |
| 10 |
|
| 11 |
Description |
| 12 |
----------- |
| 13 |
|
| 14 |
:program:`fax2tiff` creates a TIFF file containing CCITT |
| 15 |
Group 3 or Group 4 encoded data from one or more files containing "raw" |
| 16 |
Group 3 or Group 4 encoded data (typically obtained directly from a fax modem). |
| 17 |
By default, each row of data in the resultant TIFF |
| 18 |
file is 1-dimensionally encoded and |
| 19 |
padded or truncated to 1728 pixels, as needed. |
| 20 |
The resultant image is a set of low resolution (98 lines/inch) |
| 21 |
or medium resolution (196 lines/inch) |
| 22 |
pages, each of which is a single strip of data. |
| 23 |
The generated file conforms to the TIFF |
| 24 |
Class F (FAX) specification for storing facsimile data. |
| 25 |
This means, in particular, that each page of the data does |
| 26 |
**not** include the trailing |
| 27 |
*"return to control"* (``RTC``) code; as required |
| 28 |
for transmission by the CCITT Group 3 specifications. |
| 29 |
The old, "classic", format is created if the |
| 30 |
:option:`-c` option is used. |
| 31 |
(The Class F format can also be requested with the |
| 32 |
:option:`-f` option.) |
| 33 |
|
| 34 |
The default name of the output image is :file:`fax.tif`; |
| 35 |
this can be changed with the :option:`-o` option. |
| 36 |
Each input file is assumed to be a separate page of facsimile data |
| 37 |
from the same document. |
| 38 |
The order in which input files are specified on the command |
| 39 |
line is the order in which the resultant pages appear in the |
| 40 |
output file. |
| 41 |
|
| 42 |
Options |
| 43 |
------- |
| 44 |
|
| 45 |
Options that affect the interpretation of input data are: |
| 46 |
|
| 47 |
.. option:: -3 |
| 48 |
|
| 49 |
Assume input data is CCITT Group 3 encoded (default). |
| 50 |
|
| 51 |
.. option:: -4 |
| 52 |
|
| 53 |
Assume input data is CCITT Group 4 encoded. |
| 54 |
|
| 55 |
.. option:: -U |
| 56 |
|
| 57 |
Assume input data is uncompressed (Group 3 or Group 4). |
| 58 |
|
| 59 |
.. option:: -1 |
| 60 |
|
| 61 |
Assume input data is encoded with the 1-dimensional version of the CCITT |
| 62 |
Group 3 Huffman encoding algorithm (default). |
| 63 |
|
| 64 |
.. option:: -2 |
| 65 |
|
| 66 |
Assume input data is 2-dimensional version of the CCITT |
| 67 |
Group 3 Huffman encoding algorithm. |
| 68 |
|
| 69 |
.. option:: -P |
| 70 |
|
| 71 |
Assume input data is **not** |
| 72 |
EOL-aligned (default). This option has effect with Group 3 encoded input only. |
| 73 |
|
| 74 |
.. option:: -A |
| 75 |
|
| 76 |
Assume input data is EOL-aligned. This option has effect with Group 3 |
| 77 |
encoded input only. |
| 78 |
|
| 79 |
.. option:: -M |
| 80 |
|
| 81 |
Treat input data as having bits filled from most significant bit (``MSB``) to most least bit (``LSB``). |
| 82 |
|
| 83 |
.. option:: -L |
| 84 |
|
| 85 |
Treat input data as having bits filled from least significant bit (``LSB``) to most significant bit |
| 86 |
(``MSB``) (default). |
| 87 |
|
| 88 |
.. option:: -B |
| 89 |
|
| 90 |
Assume input data was encoded with black as 0 and white as 1. |
| 91 |
|
| 92 |
.. option:: -W |
| 93 |
|
| 94 |
Assume input data was encoded with black as 1 and white as 0 (default). |
| 95 |
|
| 96 |
.. option:: -R |
| 97 |
|
| 98 |
Specify the vertical resolution, in lines/inch, of the input images. |
| 99 |
By default input are assumed to have a vertical resolution of 196 lines/inch. |
| 100 |
If images are low resolution facsimile, a value of 98 lines/inch should |
| 101 |
be specified. |
| 102 |
|
| 103 |
.. option:: -X |
| 104 |
|
| 105 |
Specify the width, in pixels, of the input images. |
| 106 |
By default input are assumed to have a width of 1728 pixels. |
| 107 |
|
| 108 |
Options that affect the output file format are: |
| 109 |
|
| 110 |
.. option:: -o |
| 111 |
|
| 112 |
Specify the name of the output file. |
| 113 |
|
| 114 |
|
| 115 |
.. option:: -7 |
| 116 |
|
| 117 |
Force output to be compressed with the CCITT |
| 118 |
Group 3 Huffman encoding algorithm (default). |
| 119 |
|
| 120 |
.. option:: -8 |
| 121 |
|
| 122 |
Force output to be compressed with the CCITT |
| 123 |
Group 4 Huffman encoding. |
| 124 |
|
| 125 |
.. option:: -u |
| 126 |
|
| 127 |
Force output to be uncompressed (Group 3 or Group 4). |
| 128 |
|
| 129 |
.. option:: -5 |
| 130 |
|
| 131 |
Force output to be encoded with the 1-dimensional version of the CCITT |
| 132 |
Group 3 Huffman encoding algorithm. |
| 133 |
|
| 134 |
.. option:: -6 |
| 135 |
|
| 136 |
Force output to be encoded with the 2-dimensional version of the CCITT |
| 137 |
Group 3 Huffman encoding algorithm (default). |
| 138 |
|
| 139 |
.. option:: -a |
| 140 |
|
| 141 |
Force the last bit of each *"End Of Line"* (``EOL``) |
| 142 |
code to land on a byte boundary (default). This "zero padding" will |
| 143 |
be reflected in the contents of the ``Group3Options`` |
| 144 |
tag of the resultant TIFF file. This option has effect with Group 3 encoded output only. |
| 145 |
|
| 146 |
.. option:: -p |
| 147 |
|
| 148 |
Do not EOL-align output. This option has effect with Group 3 encoded |
| 149 |
output only. |
| 150 |
|
| 151 |
.. option:: -c |
| 152 |
|
| 153 |
Generate "classic" Group 3 TIFF format. |
| 154 |
|
| 155 |
.. option:: -f |
| 156 |
|
| 157 |
Generate TIFF Class F (TIFF/F) format (default). |
| 158 |
|
| 159 |
.. option:: -m |
| 160 |
|
| 161 |
Force output data to have bits filled from most significant bit (``MSB``) |
| 162 |
to most least bit (``LSB``). |
| 163 |
|
| 164 |
.. option:: -l |
| 165 |
|
| 166 |
Force output data to have bits filled from least significant bit (``LSB``) |
| 167 |
to most significant bit (``MSB``) (default). |
| 168 |
|
| 169 |
.. option:: -r |
| 170 |
|
| 171 |
Specify the number of rows (scanlines) in each strip of data |
| 172 |
written to the output file. |
| 173 |
By default (or when value ``0`` is specified), :program:`tiffcp` |
| 174 |
attempts to set the rows/strip |
| 175 |
that no more than 8 kilobytes of data appear in a strip (with except of G3/G4 |
| 176 |
compression schemes). If you specify special value ``-1`` |
| 177 |
it will results in infinite number of the rows per strip. The entire image |
| 178 |
will be the one strip in that case. This is default in case of G3/G4 output |
| 179 |
compression schemes. |
| 180 |
|
| 181 |
.. option:: -s |
| 182 |
|
| 183 |
Stretch the input image vertically by writing each input row of |
| 184 |
data twice to the output file. |
| 185 |
|
| 186 |
.. option:: -v |
| 187 |
|
| 188 |
Force :program:`fax2tiff` |
| 189 |
to print the number of rows of data it retrieved from the input file. |
| 190 |
|
| 191 |
.. option:: -z |
| 192 |
|
| 193 |
Force output to be compressed with the LZW encoding. |
| 194 |
|
| 195 |
Diagnostics |
| 196 |
----------- |
| 197 |
|
| 198 |
The following warnings and errors come from the decoding |
| 199 |
routines in the library. |
| 200 |
|
| 201 |
**"Warning, %s: Premature EOL at scanline %d (x %d).\en"**: |
| 202 |
|
| 203 |
The input data had a row that was shorter than the expected width. |
| 204 |
The row is padded with white. |
| 205 |
|
| 206 |
**"%s: Premature EOF at scanline %d (x %d).\en"**: |
| 207 |
|
| 208 |
The decoder ran out of data in the middle of a scanline. |
| 209 |
The resultant row is padded with white. |
| 210 |
|
| 211 |
**"%s: Bad code word at row %d, x %d\en"**: |
| 212 |
|
| 213 |
An invalid Group 3 ``code`` |
| 214 |
was encountered while decoding the input file. |
| 215 |
The row number and horizontal position is given. |
| 216 |
The remainder of the input row is discarded, while |
| 217 |
the corresponding output row is padded with white. |
| 218 |
|
| 219 |
**"%s: Bad 2D code word at scanline %d.\en"**: |
| 220 |
|
| 221 |
An invalid Group 4 or 2D Group 3 ``code`` |
| 222 |
was encountered while decoding the input file. |
| 223 |
The row number and horizontal position is given. |
| 224 |
The remainder of the input row is discarded, while |
| 225 |
the corresponding output row is padded with white. |
| 226 |
|
| 227 |
Bugs |
| 228 |
---- |
| 229 |
|
| 230 |
Input data are assumed to have a a "top left" orientation; |
| 231 |
it should be possible to override this assumption |
| 232 |
from the command line. |
| 233 |
|
| 234 |
See also |
| 235 |
-------- |
| 236 |
|
| 237 |
"CCITT Recommendation T.4" |
| 238 |
(Standardization of Group 3 Facsimile Apparatus for Document Transmission). |
| 239 |
|
| 240 |
"The Spirit of TIFF Class F", |
| 241 |
an appendix to the TIFF 5.0 specification prepared by Cygnet Technologies. |
| 242 |
|
| 243 |
:doc:`tiffinfo` (1), |
| 244 |
:doc:`tiffdither` (1), |
| 245 |
:doc:`tiffgt` (1), |
| 246 |
:doc:`/functions/libtiff` (3tiff) |