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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
.\" Man page generated from reStructuredText.
.
.TH JBIG2 1 "2016-11-05" "0.28" "SlackBuilds.org"
.SH NAME
jbig2 \- convert image files to JBIG2 format
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.\" RST source for jbig2(1) man page. Convert with:
.
.\" rst2man.py jbig2.rst > jbig2.1
.
.\" rst2man.py comes from the SBo development/docutils package.
.
.SH SYNOPSIS
.sp
\fBjbig2\fP [\fI\-options\fP] \fIimagefile\fP > \fIoutput.jb2\fP
.SH DESCRIPTION
.sp
JBIG2 is an image compression standard from the same people who brought
you the JPEG format. It compresses 1bpp (black and white) images only.
.sp
jbig2enc is a library that encodes JBIG2 images.
.sp
\fBjbig2\fP is a command\-line tool that uses the jbig2enc library to convert an
image to the JBIG2 format. \fIimagefile\fP can be in any format readable by
leptonica (png, jpeg, tiff, gif, webp, jp2, bmp, pnm, spix). The image
is converted to 1bbp (monochrome) before processing.
.sp
Without the \fI\-p\fP, \fI\-\-pdf\fP option, the converted image is written to
standard output. This should be redirected to a file, normally with
the \fI\&.jb2\fP extension. If stdout isn\(aqt redirected to a file (or a pipe),
the JBIG2 data will be written to the terminal, which may get confused.
.sp
There is no way to have \fBjbig2\fP read an image file on standard input. This
is by design, as it needs to seek within the file.
.sp
All options must appear before the filename. With the generic encoder
(no \fI\-s\fP option), anything after the filename is silently ignored. The
symbol encoder (\fI\-s\fP) can handle multiple images (which end up as pages
in the JBIG2 file).
.sp
The \fI\-r\fP, \fI\-\-refine\fP option mentioned in the documentation and in
the \fI\-\-help\fP output of \fBjbig2\fP is \fIdisabled\fP in this version of
\fBjbig2\fP\&.
.SH OPTIONS
.\" some of these are from the HTML file, some from --help.
.
.INDENT 0.0
.TP
.B \-b \fIbasename\fP
Output file root name when using symbol coding in PDF mode (\fI\-s\fP
and \fI\-p\fP). Default is \fBoutput\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-d\fP,\fB \-\-duplicate\-line\-removal
When encoding generic regions each scan line can be tagged to indicate
that it\(aqs the same as the last scanline \- and encoding that scanline
is skipped. This drastically reduces the encoding time (by a factor
of about 2 on some images) although it doesn\(aqt typically save any
bytes. This is an option because some versions of jbig2dec (an open
source decoding library) cannot handle this.
.TP
.B \-p\fP,\fB \-\-pdf
The PDF spec includes support for JBIG2 (Syntax\->Filters\->JBIG2Decode in
the PDF references for versions 1.4 and above). However, PDF requires
a slightly different format for JBIG2 streams: no file/page headers or
trailers and all pages are numbered 1. In symbol mode the output is to
a series of files: symboltable and page\-n (numbered from 0). By default
these are named \fBoutput.sym\fP and \fBoutput.0000\fP, \fBoutput.0001\fP,
etc. Use \fI\-b\fP to change the base filename.
.TP
.B \-s\fP,\fB \-\-symbol\-mode
Use symbol encoding. Turn on for scanned text pages.
.UNINDENT
.INDENT 0.0
.TP
.B \-t \fIthreshold\fP
Sets the fraction of pixels which have to match in order for
two symbols to be classed the same. This isn\(aqt strictly true, as there are
other tests as well, but increasing this will generally increase the number
of symbol classes. Default is 0.85.
.TP
.B \-T \fIthreshold\fP
Sets the black threshold (0\-255). Any gray value darker than
this is considered black. Anything lighter is considered white.
Default is 188.
.TP
.B \-O \fIoutfile\fP
Dump a PNG of the 1 bpp image before encoding. Can be used to
test loss.
.UNINDENT
.INDENT 0.0
.TP
.B \-2\fP,\fB \-4
Upscale either two or four times before converting to black and
white.
.TP
.B \-S
Segment an image into text and non\-text regions. This isn\(aqt perfect, but
running text through the symbol compressor is terrible so it\(aqs worth doing
if your input has images in it (like a magazine page).
.TP
.B \-\-image\-output
Set filename to which the parts which were removed by \-S are written.
Default is PNG format.
.TP
.B \-j\fP,\fB \-\-jpeg\-output
Write images from \-S as JPEG instead of PNG.
.TP
.B \-a\fP,\fB \-\-auto\-thresh
Use automatic thresholding in symbol encoder.
.TP
.B \-\-no\-hash
Disables use of hash function for automatic thresholding.
.TP
.B \-v
Be verbose.
.TP
.B \-V\fP,\fB \-\-version
Display version number and exit.
.TP
.B \-h\fP,\fB \-\-help
Display help and exit.
.UNINDENT
.SH EXIT STATUS
.sp
\fBjbig2\fP exits with 0 (success) status if the conversion completed
OK, and non\-zero status if anything went wrong. If standard output was
redirected to a file, the file will be empty or invalid when non\-zero
status is returned. Diagnostic messages are printed to standard error.
.SH COPYRIGHT
.sp
See the file /usr/doc/jbig2enc\-0.28/COPYING for license information.
.sp
This software is a description of processes which may be patented.
.sp
Use of this software may require patent licenses in some countries.
You are directed to annex I of the JBIG2 specification for information.
.INDENT 0.0
.TP
.B Some information could be found at:
\fI\%http://www.jpeg.org/jbig/index.html\fP
\fI\%http://www.cl.cam.ac.uk/~mgk25/jbigkit/patents/\fP
\fI\%http://www.jpeg.org/public/fcd14492.pdf\fP
\fI\%http://itscj.ipsj.or.jp/sc29/open/29view/29n55161.doc\fP
.UNINDENT
.SH AUTHORS
.INDENT 0.0
.TP
.B jbig2 and jbig2enc were written by:
Adam Langley <\fI\%agl@imperialviolet.org\fP>.
.UNINDENT
.sp
This man page written for the SlackBuilds.org project
by B. Watson, and is licensed under the WTFPL.
.SH SEE ALSO
.sp
\fBpdf.py(1)\fP, \fBjbig2dec(1)\fP
.INDENT 0.0
.TP
.B Full documentation for jbig2 and jbig2enc:
/usr/doc/jbig2enc\-0.28/jbig2enc.html
.TP
.B The JBIG2 specification was formerly located at:
\fI\%http://www.jpeg.org/public/fcd14492.pdf\fP
.TP
.B A copy can be found here:
\fI\%http://www.hlevkin.com/Standards/fcd14492.pdf\fP
.UNINDENT
.\" Generated by docutils manpage writer.
.
|