From: rrosen@cesl.rutgers.edu (Robert Rosenbaum)
Newsgroups: alt.graphics.pixutils
Subject: responses to pbm<->fax conversion question
Summary: a summary of responses to my previous question
Keywords: fax tiff g4 conversion pbmtog3
Date: 11 Oct 92 19:09:24 GMT
Organization: Rutgers Univ., New Brunswick, N.J.

Several people sent helpful responses to my FAX conversion question.
Since others may have had similar questions, here is a summary of the
responses.  Please see also the posting by Jef Poskanzer in response
to my original posting.

From Tom.Lane@g.gp.cs.cmu.edu Mon Sep 28 12:45:14 1992

One of the possible data compression methods for
TIFF is the same as the data compression method used by G3 FAX.
However, the overall format (headers etc) of a TIFF file is nothing like
a plain G3 FAX datastream.  It sounds like your fax modem outputs TIFF files
rather than the raw G3 data it is receiving.

G3 FAX format has a hard-wired image width of 1728 pixels.
pbmtog3 pads input images to this width (something that should be
documented...)

Try feeding your modem a g3 TIFF file (see pnmtotiff -g3), or perhaps
an uncompressed TIFF file (pnmtotiff -none).

:::::::::::

From jnakulsk@cssc-melb.tansu.com.au Mon Oct  5 19:35:07 1992

(1) Just about every fax modem / fax software developer uses a different format
for their fax files. Generally, the "data" parts are the same (the data parts
are in the T4 fax format, for which I have a copy of the relevant standard),
but they all seem to use a different "header" format for the other information
that they might want to store (eg, file length, creation date, sender,
recipient, number of pages, etc.).
If you read the .man page for g3topbm, you will see that there are options for
stripping off the first few lines of the file (ie, the "header").
(2) The pbmplus software (pbmtog3 and g3topbm) only handles single page faxes.
G3topbm either bombs on large faxes or strips off the first page (I can't
remember which). I don't know of any way to combine several pbm files into one
g3 fax.
(3) g3topbm probably puts white space on the right side of your fax page
because it rounds off the number of pixels in the horixontal direction (ie, the
width) to a multiple of 8, when the "P2" or "compressed" pbm format is used, in
order to facilitate later decoding.
(4) Yes, I believe that T4 (G3) encoding and one of the many types of TIFF
encoding use the same coding algorithm.
(5) Yes, you need to ask the developer of your fax modem software for the
format of fax files so that you can prepend the appropriate header information
to your g3 or tiff files.

:::::::::::

From: wes@kofax.kofax.com

	pbmtog3 does not create a TIFF file; I believe it just creates
a Group 3 compressed image with no header.  TIFF files can contain
images in a number of different formats (including Group 3 compressed
black and white images), so loosley speaking there IS such as thing as
a G3 TIFF file.

	The programs you should use to read and write TIFF images with
the PBM utilites are pnmtotiff and tifftopnm.  These utilities can
handle Group 3 as well as other data types.  These programs require
libtiff, another publicly available package.  One note -- pnmtotiff
requires a lot of memory.  It reads the entire image into memory at 1
byte per pixel (or 3 bytes if a PPM image).  If you just want to
convert a PBM file to Group 3/TIFF, I can send you a much less memory
intensive utility (pbmtotiff) I threw together one day.

:::::::

Thanks for the replies.
Rob
rrosen@caip.rutgers.edu