The fax service says it will accept "binary group 3 fax" and "TIFF CCITT group 3 & 4" (among many others). Group 4 fax is apparently for ISDN lines, and Group 3 is for POTS lines. Since most ppl have POTS, I'm thinking group 3 is what I should target. It's confusing to even know what file to produce, because there are these -compress options:
- Fax (is this group 3 compression?)
- Group4
- FAX (group 3 FAX)
- G3 (group 3 FAX)
- G4 (group 4 FAX)
- GROUP4 (TIFF Raw CCITT Group4)
- PDF (works with Fax/Group4 compression)
- TIFF
Is "GROUP4" a synonym for "G4"? Is the "GROUP4" format also a synonym for -compress Group4 outputfile.tiff?
I need to produce something that is multiple pages and as close to best fax-conforming quality as possible. Ideally all the conversion loss happens on my end, so the fax service doesn't have much affect on the quality - ultimately to know what will arrive. This is my (broken) approach:
Code: Select all
$ pdf2djvu -o vector.djvu vector.pdf
$ ddjvu -format=pdf -quality=80 vector.djvu raster.pdf
$ convert raster.pdf -colorspace gray +dither -colors 2 -normalize -monochrome -threshold 70% -despeckle -resample 25x38 -units PixelsPerInch -compress Fax G3:fax.tiff
$ display fax.tiff
display-im6.q16: Not a TIFF or MDI file, bad magic number 65535 (0xffff). `fax.tiff' @ error/tiff.c/TIFFErrors/564.
Code: Select all
$ convert raster.pdf -colorspace gray +dither -colors 2 -normalize -monochrome -threshold 70% -despeckle -resample 25x38 -units PixelsPerInch -compress Fax fax.g3
$ display fax.g3
Code: Select all
Image: fax.g3
Format: G3 (Group 3 FAX)
Class: PseudoClass
Geometry: 2592x418+0+0
Resolution: 204x196
Print size: 12.7059x2.13265
Units: PixelsPerInch
Type: Bilevel
(edit)
I've found there exists a "TIFF-F (Class F)", which is a TIFF format that was designed specifically for fax. There is no class F TIFF in the output of convert -list format. So it seems ImageMagick is useful for despecking, bi-leveling, and changing the resolution, and then to finalize it into a class-F TIFF I'll need fax2tiff (part of the libtiff-tools pkg).