Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

cjb2(1) [debian man page]

CJB2(1) 							   DjVuLibre-3.5							   CJB2(1)

NAME
cjb2 - Simple DjVuBitonal encoder. SYNOPSIS
cjb2 [options] inputfile outputdjvufile DESCRIPTION
This is a simple encoder for bitonal files. Argument inputfile is the name of a PBM or bitonal TIFF file containing a single document image. 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 options -losslevel, -lossy, or -clean. 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 resolution for TIFF files is the resolution is the resolution specified by the input file. The default resolution for PBM files is 300 dpi. -lossless Ensure that the encoded image is pixel-per-pixel equal to the initial image. This option is is equivalent to -losslevel 0 and is the default. -clean Only 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 spec- ified with option This option is is equivalent to -losslevel 1. -lossy Substitute patterns with small variations. In addition to the flyspeck removal heuristic, this option enables an algorithm that encodes certain characters by simply replicating the shape of a previously encoded character with a similar shape. This option is is equivalent to -losslevel 100. -losslevel x Specify the aggressiveness of the lossy compression. Its argument ranges from 0 to 200. Higher values generate smaller files with more potential distortions. Loss level 0 corresponds to lossless encoding. Loss level 1 performs image cleaning but does not per- form character substitution at all. Loss level 100 is intended to provide a good compromise. Higher loss levels provide marginally better compression at the risk of unacceptable character substitutions. -verbose Display informational messages while running. REMARKS
Lossless encoding is competitive with that of the Lizardtech commercial encoders. Lossy encoding has made much progress thanks to Ilya Mezhirov from the minidjvu project. This also means that the lossy encoding perfor- mance can change from version to version. When lossy compression yields inadequate results, simply revert to only using option -clean or reduce the parameter of option -losslevel. Two features are still missing: * Half-tone detection. Collecting small marks belonging to half-tone patterns would improve compression speed. * Multi-page compression. Matching characters on several pages would improve the compression ratios for multi-page documents. CREDITS
This program was initially written by Leon Bottou <leonb@users.sourceforge.net> and was improved by Bill Riemers <docbill@sourceforge.net> and many others. The pattern matching algorithm for lossy compression was contributed by Ilya Mezhirov <ilya@mezhirov.mccme.ru>. TIFF input routines are inspired by the ones contributed by R. Keith Dennis <dennis@rkd.math.cornell.edu> and Paul Young. SEE ALSO
djvu(1), pbm(5). DjVuLibre-3.5 10/11/2001 CJB2(1)

Check Out this Related Man Page

DDJVU(1)							   DjVuLibre-3.5							  DDJVU(1)

NAME
ddjvu - Command line DjVu decoder. SYNOPSIS
ddjvu -format=fmt [options] [djvufile] [outputfile] DESCRIPTION
Decode the DjVu file djvufile, produces the image file outputfile. The DjVu data is read from the standard input when argument djvufile is not specified or when it is equal to a single dash. Similarly, the output data is written to the standard output when argument outputfile is not specified or equal to a single dash. However a valid output file name is always required when producing a TIFF or PDF file. MAIN OPTIONS
-format=fmt Specify the output file formats. The recognized file formats are pbm, pgm, ppm, pnm, rle, tiff, and pdf. * Formats pbm, pgm, and ppm respectively produce a Portable Bitmap (PBM), Portable Graymap (PGM), or Portable Pixmap (PGM) file. Format pnm produces a PBM, PGM, or PPM output file according to the color content of the output image. * Format rle produces a compact run length encoded bitonal file that is understood by the DjVuLibre commands cjb2 and csepdjvu. * Format tiff produces a Tagged Image Format (TIFF) file. The resulting file uses the best available lossless compression model. Enabling lossy JPEG compression (see option -quality below) often produces much smaller files. Commands tiffcp(1) and tiffs- plit(1) are useful for manipulating the resulting TIFF files. * Format pdf produces a Portable Document Format (PDF) file. Each page in the resulting file is represented by an image at the specified resolution, using the best available lossless compression model. Enabling lossy JPEG compression (see option -quality below) often produces much smaller files. An alternate way to produce PDF file consists in first using djvups(1) and convert the resulting PostScript file to PDF. Which method gives better results depends on the contents of the DJVU file and on the capabil- ities of the PS to PDF converter. When option -format is not specified, the extension of argument outputfile has no influence on the default output format. Instead the program behavior is modified to ensure backward compatibility with previous versions of ddjvu. We recommend to always specify the output format using this option. -page=pagespec Specify which pages should be decoded. When this option is not specified, all pages of the documents are decoded and concatenated into the output file. The page specification pagespec contains one or more comma-separated page ranges. A page range is either a page number, or two page numbers separated by a dash. For instance, specification 1-10 outputs pages 1 to 10, and specification 1,3,99999-4 outputs pages 1 and 3, followed by all the document pages in reverse order up to page 4. -mode=mod Selects which layers of the DjVu image should be rendered. Valid rendering modes are color, black, mask, foreground, and back- ground. * Rendering mode color is the default mode. When the DjVu file is bitonal, bitonal or gray-level output is produced depending on the subsampling factor. Otherwise a color image is produced. * Rendering mode black is useful to extract a meaningful black and white image. bitonal or gray-level output is produced depending on the subsampling factor. * Rendering modes mask, foreground, and background select specific layers of a DjVu image. These modes can fail if the DjVu image does not contain the selected layer. RESOLUTION OPTIONS
The following options control the resolution of the output image. The default resolution is the native resolution of the DjVu file, equiv- alent to selecting -1. -n Specify an integer sub-sampling factor. The dimensions of the full output image will be n times smaller than the DjVu image size. The legal values for argument n range from 1 to 12. Option -1, for instance, produces an output image whose resolution is equal to the resolution of the input DjVu image file. -subsample=n This is equivalent to option -n. -scale=mag Specify a magnification factor relative to the resolution stored in the DjVu image. Specifying magnification of 100 produces an image suitable for displaying on a 100 dpi device such as a computer screen. The magnification factor mag can also be interpreted as the resolution of the output image expressed in dot per inch. -size=wxh Specify the size of the full output image. Rendering the full DjVu image would create an output image whose width and height would not exceed w and h. To change the aspect ratio, you must also use option -aspect=no. -aspect=yesno This option indicates whether the image aspect ratio should be preserved. The defaults is to preserve the aspect ration. This option permits changes in the aspect ratio when used in combination with option -size. OTHER OPTIONS
-verbose Display informational messages describing the structure of the DjVu image and the format of the output file. -segment=wxh+x+y Specify an image segment to render. Program ddjvu conceptually renders the full page using the specified resolution, and then extracts a sub-image of width w and height h, starting at position (x,y) relative to the bottom left corner of the page. Both oper- ations of course happen simultaneously. Rendering a small sub-image is much faster than rendering the complete image. The output file will always have size wxh when this option is specified. -quality=factor Enables lossy compression in TIFF and PDF files. Without this option, TIFF or PDF output files always use lossless compression or no compression. Argument factor specifies a JPEG quantization factor ranging from 25 to 150. See command cjpeg(1) for more informa- tion on JPEG quantization factors. Value 80 is a good starting point. DEPRECATED OPTIONS
Various options have been maintained to ensure backward compatibility with previous versions of ddjvu. When option -format is not speci- fied, the program only decodes the first page of the document and the default resolution becomes -scale=100. Options -size, -scale, -seg- ment, and -page accept an argument separated by a space. Options -foreground, -background, and -black are shorthands for the -mode=mod option. Please do not rely on these features. EXAMPLES
Command ddjvu -format=tiff myfile.djvu myfile.tif decodes all pages and produces a multipage TIFF file. Command ddjvu -format=ppm -page=1 -size=100x100 myfile.djvu - produces a thumbnail for the first page of a document and outputs it as a PPM file on the standard output. CREDITS
The new version of this program was written by Leon Bottou <leonb@users.sourceforge.net>. This program includes code derived from program tiff2pdf, written by Ross Finlayson and released under a BSD license. SEE ALSO
djvu(1), djview(1), pnm(5), pbm(5), pgm(5), ppm(5), cjpeg(1), tiffsplit(1), tiffcp(1) DjVuLibre-3.5 10/19/2002 DDJVU(1)
Man Page