Image Conversion Library

The Commetrex Image Conversion Library (ICL) is a software package that supports the real-time conversions required by Commetrex’ PortableT.30 and a set of off-line conversions which support the creation of complex fax-image files. ICL’s support for dynamic re-encoding and page-width resizing means that T.30 connect negotiations will not fail due to a mismatch in facilities between the sending and receiving terminals.

ICL supports all T.4 and T.6 formats including:

  • Metric- and inch-based page sizes
  • A4, B4 and A3 image sizes
  • All Resolutions including 100×100, 200×200, 300×300 and 400×400
  • MH, MR and MMR codings

The library can read a number of popular image formats:

  • TIFF-F
  • ASCII Text
  • DCX
  • JTFax Format
  • Bi-Level TIFF
  • PCX
  • Commetrex Fax Description Language

ICL can write TIFF-F with any TIFF-F-supported compression or uncompressed Bi-level TIFF. It is fully compliant with the TIFF format specified in IETF RFC2301.

Additional features include:

  • Flexible, dynamic scaling
  • Comprehensive header/footer facility (S.100 Compatible).
  • Access to all system fonts.
  • Configurable bad-line repair

ICL is primarily intended to support Commetrex’ PortableT.30 with real-time conversions for both transmit and receive operations. However, the package can be used to provide file conversions with off-line drivers.


  • Portable
  • A4, B4 and A3 image-size support
  • Supports S.100
  • Commetrex’ Fax Definition Language
  • Header/Footer
  • Dynamic (on-the-fly) image resizing
  • Tight, efficient code


  • Easily create complex, attractive faxes
  • Supports highest connect rates
  • Low resource utilization
  • Easily ported to host or embedded implementations

Image Conversion

Transmit Operation

As part of the negotiations of a fax session, the transmitter determines the image format as to

  • Resolution
  • Page Size
  • Encoding
  • Minimum line length

Furthermore, the addition of a header/footer to the image must be performed immediately prior to transmission. As a result, the T.30 protocol engine must usually convert the stored image during transmission. The ICL has two components that support the T.30 transmit operation, the Reader (RDR) package and the Convert (CNV) package. The RDR package produces bit-mapped data at a specified image width and resolution, performing scaling as required. The CNV package accepts bit-mapped images, adds a header/footer and encodes the image data for transmission in the format specified by T.30. The diagram above is a structure chart for utilizing the conversion library for transmission.

The process of transmission starts with calling RDR_Get_File_Attributes. This routine “tastes” the file and determines its type and the format of the image data it contains. These returns are used by the controller to determine the best transmission format. For example, if the file is low resolution, T.30 should negotiate low-resolution transmission, since sending at high resolution would only result in extra transmission time. Once T.30 has negotiated an appropriate rate, it can open the CNV package and specify the negotiated format as the output format and the file format as the input format. From that point on, T.30 can pull buffers of bit-mapped data from the RDR package, passing those buffers to the CNV package, which then returns transmittable image data. The transmittable image data are then passed to the modem for transmission.

Image Conversion

At the completion of a page, the RDR_Get_Bitmap_Line routine returns an indicator that the page is complete and whether there are more pages in the file. T.30 uses this indicator to formulate the Post Page Message. After the post page message exchange, T30 calls RDR_Goto_Next_Page to advance to the next image page.

Receive Operation

For reception, the T.30 controller utilizes the DIO package to write TIFF-F files and the CVT package to analyze and repair bad lines, and format the image for storage. The T.30 controller supplies buffers of incoming image data to the conversion package. ICL analyzes the image data, locating and repairing bad lines, and reformats the image data for disk storage. The structure chart for this operation is displayed above.

The reception process requires that the controller pass successive buffers to the CNV_Convert_Buffer function. This routine analyzes the bad line and repairs them, and converts the received image format to that required for the output file. The converted data are passed to the DIO_Write_Image routine for output to the TIFF file. After each buffer conversion, the controller should call CNV_Get_Image_Quality to monitor the quality of the image. During reception, the “Bytes Since Last EOL” value should be used to determine if the T.30 dictated 5.0-seconds-between-EOLs rule had been violated. If it has, the controller should disconnect. At the end of the image this routine returns the values required to choose from RTN, RTP, or MCF for the post page response. To begin receiving the next page, the controller calls DIO_Advance_Page and repeats the process. After the last page, the call to DIO_Close completes writing of the page attributes in the TIFF file and closes the file.



The CCL implements an ECTF S.100 compatible header/footer facility. The facility is controlled by the following structure.

Parameter Description
Header String ASCII string to drive format of the header line.
Footer String ASCII string to drive format of the footer line.
Rendering Mode Method to use for adding hdr/ftr: Insert, Append, Overlay.
Local ID Phone number of the local end.
Remote ID ID of the remote end.
Total Page Total number of pages in the Fax.
Current Page Current page number
Font Face Font type face to use for rendering the header/footer.
Font Size Size of font in points
Font Selection Attributes of the font.
Character Set Character set of the font to use.
Wrap Lines Determine if the header/footer is to wrap or be truncated if the rendered header/footer exceeds the size of the page.
Page Margins Specifies the number of pixels of margin on the left and right.