File: cjb2.1

package info (click to toggle)
djvulibre 3.5.27.1-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,976 kB
  • ctags: 8,037
  • sloc: cpp: 65,455; xml: 5,723; ansic: 4,640; sh: 846; makefile: 315
file content (136 lines) | stat: -rw-r--r-- 4,718 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.\" Copyright (c) 2001-2003 Leon Bottou, Yann Le Cun, Patrick Haffner,
.\" Copyright (c) 2001 AT&T Corp., and Lizardtech, Inc.
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual. Otherwise check the web site
.\" of the Free Software Foundation at http://www.fsf.org.
.TH CJB2 1 "10/11/2001" "DjVuLibre-3.5" "DjVuLibre-3.5"
.SH NAME
cjb2 \- Simple DjVuBitonal encoder.

.SH SYNOPSIS
.BI "cjb2  [" "options" "] " "inputfile" " " "outputdjvufile"

.SH DESCRIPTION
This is a simple encoder for bitonal files.
Argument 
.I inputfile
is the name of a 
.SM PBM
or bitonal
.SM TIFF
file containing a single document image.
This program produces a DjVuBitonal file named
.IR 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
.BR -losslevel ,
.BR -lossy ,
or
.BR -clean .

.SH OPTIONS
.TP
.BI "-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 
.SM TIFF
files is the resolution is the resolution specified by the input file.
The default resolution for
.SM PBM
files is 300 dpi.
.TP
.B "-lossless"
Ensure that the encoded image is pixel-per-pixel equal
to the initial image. 
This option is is equivalent to 
.BR "-losslevel 0" 
and is the default.
.TP
.B "-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
specified with option 
This option is is equivalent to 
.BR "-losslevel 1" .
.TP
.B "-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 
.BR "-losslevel 100" .
.TP
.BI "-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 perform
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. 
.TP
.B "-verbose"
Display informational messages while running.

.SH REMARKS
Lossless encoding is competitive with that of the 
Lizardtech commercial encoders. 
.PP
Lossy encoding has made much progress thanks
to Ilya Mezhirov from the minidjvu project.
This also means that the lossy encoding performance
can change from version to version.
When lossy compression yields inadequate results,
simply revert to only using option
.BR -clean 
or reduce the parameter of option
.BR -losslevel .
.PP
Two features are still missing:
.IP "*" 3
Half-tone detection. Collecting small marks belonging 
to half-tone patterns would improve compression speed.
.IP "*" 3
Multi-page compression. Matching characters on several pages
would improve the compression ratios for multi-page documents.

.SH CREDITS
This program was initially written by L\('eon 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.

.SH SEE ALSO
.BR djvu (1),
.BR pbm (5).