Blame tools/cjb2.1

Packit df99a1
.\" Copyright (c) 2001-2003 Leon Bottou, Yann Le Cun, Patrick Haffner,
Packit df99a1
.\" Copyright (c) 2001 AT&T Corp., and Lizardtech, Inc.
Packit df99a1
.\"
Packit df99a1
.\" This is free documentation; you can redistribute it and/or
Packit df99a1
.\" modify it under the terms of the GNU General Public License as
Packit df99a1
.\" published by the Free Software Foundation; either version 2 of
Packit df99a1
.\" the License, or (at your option) any later version.
Packit df99a1
.\"
Packit df99a1
.\" The GNU General Public License's references to "object code"
Packit df99a1
.\" and "executables" are to be interpreted as the output of any
Packit df99a1
.\" document formatting or typesetting system, including
Packit df99a1
.\" intermediate and printed output.
Packit df99a1
.\"
Packit df99a1
.\" This manual is distributed in the hope that it will be useful,
Packit df99a1
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit df99a1
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit df99a1
.\" GNU General Public License for more details.
Packit df99a1
.\"
Packit df99a1
.\" You should have received a copy of the GNU General Public
Packit df99a1
.\" License along with this manual. Otherwise check the web site
Packit df99a1
.\" of the Free Software Foundation at http://www.fsf.org.
Packit df99a1
.TH CJB2 1 "10/11/2001" "DjVuLibre-3.5" "DjVuLibre-3.5"
Packit df99a1
.SH NAME
Packit df99a1
cjb2 \- Simple DjVuBitonal encoder.
Packit df99a1
Packit df99a1
.SH SYNOPSIS
Packit df99a1
.BI "cjb2  [" "options" "] " "inputfile" " " "outputdjvufile"
Packit df99a1
Packit df99a1
.SH DESCRIPTION
Packit df99a1
This is a simple encoder for bitonal files.
Packit df99a1
Argument 
Packit df99a1
.I inputfile
Packit df99a1
is the name of a 
Packit df99a1
.SM PBM
Packit df99a1
or bitonal
Packit df99a1
.SM TIFF
Packit df99a1
file containing a single document image.
Packit df99a1
This program produces a DjVuBitonal file named
Packit df99a1
.IR outputdjvufile .
Packit df99a1
Packit df99a1
The default compression process is lossless: 
Packit df99a1
decoding the DjVuBitonal file at full resolution will 
Packit df99a1
produce an image exactly identical to the input file.
Packit df99a1
Lossy compression is enabled by options
Packit df99a1
.BR -losslevel ,
Packit df99a1
.BR -lossy ,
Packit df99a1
or
Packit df99a1
.BR -clean .
Packit df99a1
Packit df99a1
.SH OPTIONS
Packit df99a1
.TP
Packit df99a1
.BI "-dpi " "n"
Packit df99a1
Specify the resolution information encoded into the output file expressed in
Packit df99a1
dots per inch. The resolution information encoded in DjVu files determine how
Packit df99a1
the decoder scales the image on a particular display.  Meaningful resolutions
Packit df99a1
range from 25 to 1200.  The default resolution for 
Packit df99a1
.SM TIFF
Packit df99a1
files is the resolution is the resolution specified by the input file.
Packit df99a1
The default resolution for
Packit df99a1
.SM PBM
Packit df99a1
files is 300 dpi.
Packit df99a1
.TP
Packit df99a1
.B "-lossless"
Packit df99a1
Ensure that the encoded image is pixel-per-pixel equal
Packit df99a1
to the initial image. 
Packit df99a1
This option is is equivalent to 
Packit df99a1
.BR "-losslevel 0" 
Packit df99a1
and is the default.
Packit df99a1
.TP
Packit df99a1
.B "-clean"
Packit df99a1
Only remove flyspecks from the input image. 
Packit df99a1
This option enables a heuristic algorithm that removes very small marks.  
Packit df99a1
Such marks are often causes by noise and dust during the scanning process.
Packit df99a1
The threshold mark size is chosen according to the resolution
Packit df99a1
specified with option 
Packit df99a1
This option is is equivalent to 
Packit df99a1
.BR "-losslevel 1" .
Packit df99a1
.TP
Packit df99a1
.B "-lossy"
Packit df99a1
Substitute patterns with small variations.
Packit df99a1
In addition to the flyspeck removal heuristic, this option
Packit df99a1
enables an algorithm that encodes certain characters
Packit df99a1
by simply replicating the shape of a previously encoded character
Packit df99a1
with a similar shape.
Packit df99a1
This option is is equivalent to 
Packit df99a1
.BR "-losslevel 100" .
Packit df99a1
.TP
Packit df99a1
.BI "-losslevel " "x"
Packit df99a1
Specify the aggressiveness of the lossy compression.
Packit df99a1
Its argument ranges from 0 to 200. 
Packit df99a1
Higher values generate smaller files 
Packit df99a1
with more potential distortions.
Packit df99a1
Loss level 0 corresponds to lossless encoding.
Packit df99a1
Loss level 1 performs image cleaning but does not perform
Packit df99a1
character substitution at all.
Packit df99a1
Loss level 100 is intended to provide a good compromise.
Packit df99a1
Higher loss levels provide marginally better compression
Packit df99a1
at the risk of unacceptable character substitutions. 
Packit df99a1
.TP
Packit df99a1
.B "-verbose"
Packit df99a1
Display informational messages while running.
Packit df99a1
Packit df99a1
.SH REMARKS
Packit df99a1
Lossless encoding is competitive with that of the 
Packit df99a1
Lizardtech commercial encoders. 
Packit df99a1
.PP
Packit df99a1
Lossy encoding has made much progress thanks
Packit df99a1
to Ilya Mezhirov from the minidjvu project.
Packit df99a1
This also means that the lossy encoding performance
Packit df99a1
can change from version to version.
Packit df99a1
When lossy compression yields inadequate results,
Packit df99a1
simply revert to only using option
Packit df99a1
.BR -clean 
Packit df99a1
or reduce the parameter of option
Packit df99a1
.BR -losslevel .
Packit df99a1
.PP
Packit df99a1
Two features are still missing:
Packit df99a1
.IP "*" 3
Packit df99a1
Half-tone detection. Collecting small marks belonging 
Packit df99a1
to half-tone patterns would improve compression speed.
Packit df99a1
.IP "*" 3
Packit df99a1
Multi-page compression. Matching characters on several pages
Packit df99a1
would improve the compression ratios for multi-page documents.
Packit df99a1
Packit df99a1
.SH CREDITS
Packit df99a1
This program was initially written by L\('eon Bottou
Packit df99a1
<leonb@users.sourceforge.net> and was improved 
Packit df99a1
by Bill Riemers <docbill@sourceforge.net> and many others.
Packit df99a1
The pattern matching algorithm for lossy compression
Packit df99a1
was contributed by Ilya Mezhirov <ilya@mezhirov.mccme.ru>.
Packit df99a1
TIFF input routines are inspired by the ones contributed by 
Packit df99a1
R. Keith Dennis <dennis@rkd.math.cornell.edu> and Paul Young.
Packit df99a1
Packit df99a1
.SH SEE ALSO
Packit df99a1
.BR djvu (1),
Packit df99a1
.BR pbm (5).