CJB2(1)

NAME
cjb2 - Simple DjVuBitonal encoder.

SYNOPSIS
cjb2 [options] inputpbmfile outputdjvufile

DESCRIPTION
This is a simple encoder for bitonal files. Argument inputpbmfile is the name of a PBM file containing the black-and-white image of a document. This program produces a DjVuBitonal file named outputdjvufile. The default compression process is lossless: decoding the DjVuBitonal file at full resolution will produce an image exactly identical to the input file. Lossy compression is enabled by selecting option -clean and/or option -loose.

OPTIONS

-dpi n
    Specify the resolution information encoded into the output file expressed in dots per inch. The resolution information encoded in DjVu files determine how the decoder scales the image on a particular display. Meaningful resolutions range from 25 to 1200. The default value is 300 dpi.

-clean
    Remove flyspecks from the input image. This option enables a heuristic algorithm that removes very small marks. Such marks are often causes by noise and dust during the scanning process. The threshold mark size is chosen according to the resolution specified with option -dpi.

-loose
    Substitute patterns with small variations. This option enables a heuristic algorithm that encodes certain characters by simply replicating the shape of a previously encoded character. The shape difference between both characters must represent less than 6% of the pixels in the character bounding box.

-verbose
    Display informational messages while running.

REMARKS
Lossless encoding is competitive with that of the Lizardtech commercial encoders. Lossy encoding mode lags behind. Additional algorithms could improve the overall performance:

*   Detecting small marks belonging to half-tone patterns would improve compression speed.

*   Multi-page character matches would improve the compression ratios for multi-page documents.

*   A better pattern matching code would improve the lossy compression ratios.

CREDITS
This program was initially written by Léon Bottou <leonb@users.sourceforge.net> and was improved by Bill Riemers <bcr@lizardtech.com> and many others.

SEE ALSO
djvu(1), pbm(5), pnmtotiff(1),