version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
PNMTOJBIG |
|
|
2 |
!!!PNMTOJBIG |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
FORMATS |
|
|
8 |
STANDARDS |
|
|
9 |
AUTHOR |
|
|
10 |
SEE ALSO |
|
|
11 |
LICENSE |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
pnmtojbig - PNM to JBIG file converter |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__pnmtojbg__ [[ ''options'' ] [[ ''input-file'' | - [[ |
|
|
21 |
''output-file'' ]] |
|
|
22 |
!!DESCRIPTION |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
Reads in a PBM or PGM format image from a file or standard |
|
|
26 |
input, compresses it, and outputs the image as a ''JBIG'' |
|
|
27 |
bi-level image entity (BIE) file. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
''JBIG'' is a highly effective lossless compression |
|
|
31 |
algorithm for bi-level images (one bit per pixel), which is |
|
|
32 |
particularly suitable for scanned document |
|
|
33 |
pages. |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
A ''JBIG'' encoded image can be stored in several |
|
|
37 |
resolutions (progressive mode). These resolution layers can |
|
|
38 |
be stored all in one single BIE or they can be stored in |
|
|
39 |
several separate BIE files. All resolution layers except the |
|
|
40 |
lowest one are stored merely as differences to the next |
|
|
41 |
lower resolution layer, because this requires less space |
|
|
42 |
than encoding the full image completely every time. Each |
|
|
43 |
resolution layer has twice the number of horizontal and |
|
|
44 |
vertical pixels than the next lower layer. ''JBIG'' files |
|
|
45 |
can also store several bits per pixel as separate bitmap |
|
|
46 |
planes, and __pnmtojbig__ can read a PGM file and |
|
|
47 |
transform it into a multi-bitplane BIE. |
|
|
48 |
!!OPTIONS |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
__-__ A single hyphen instead of an input file name will |
|
|
52 |
cause __pnmtojbg__ to read the data from standard input |
|
|
53 |
instead from a file. |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
__-q__ Encode the image in one single resolution layer |
|
|
57 |
(sequential mode). This is usually the most efficient |
|
|
58 |
compression method. By default, the number of resolution |
|
|
59 |
layers is chosen automatically such that the lowest layer |
|
|
60 |
image is not larger than 640 480 pixels. |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
__-x__ ''number'' |
|
|
64 |
|
|
|
65 |
|
|
|
66 |
Specify the maximal horizontal size of the lowest resolution |
|
|
67 |
layer. The default is 640 pixels. |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
__-y__ ''number'' |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
Specify the maximal vertical size of the lowest resolution |
|
|
74 |
layer. The default is 480 pixels. |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
__-l__ ''number'' |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
Select the lowest resolution layer that will be written to |
|
|
81 |
the BIE. It is possible to store the various resolution |
|
|
82 |
layers of a ''JBIG'' image in progressive mode into |
|
|
83 |
different BIEs. Options __-l__ and __-h__ allow to |
|
|
84 |
select the resolution-layer interval that will appear in the |
|
|
85 |
created BIE. The lowest resolution layer has number 0 and |
|
|
86 |
this is also the default value. By default all layers will |
|
|
87 |
be written. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__-h__ ''number'' |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
Select the highest resolution layer that will be written to |
|
|
94 |
the BIE. By default all layers will be written. See also |
|
|
95 |
option __-l.__ |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
__-b__ Use binary values instead of Gray code words in |
|
|
99 |
order to encode pixel values in multiple bitplanes. This |
|
|
100 |
option has only an effect if the input is a PGM file and if |
|
|
101 |
more than one bitplane is produced. Note that the decoder |
|
|
102 |
has to make the same selection but cannot determine from the |
|
|
103 |
BIE, whether Gray or binary code words were used by the |
|
|
104 |
encoder. |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
__-d__ ''number'' |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
Specify the total number of differential resolution layers |
|
|
111 |
into which the input image will be split in addition to the |
|
|
112 |
lowest layer. Each additional layer reduces the size of |
|
|
113 |
layer 0 by 50 %. This option overrides options __-x__ and |
|
|
114 |
__-y__ which are usually a more comfortable way of |
|
|
115 |
selecting the number of resolution layers. |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
__-s__ ''number'' |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
The ''JBIG'' algorithm splits each image into a number of |
|
|
122 |
horizontal stripes. This option specifies that each stripe |
|
|
123 |
shall have ''number'' lines in layer 0. The default value |
|
|
124 |
is selected so that approximately 35 stripes will be used |
|
|
125 |
for the whole image. |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
__-m__ ''number'' |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
Select the maximum horizontal offset of the adaptive |
|
|
132 |
template pixel. The ''JBIG'' encoder uses a number of |
|
|
133 |
neighbour pixels in order to get statistical a priori |
|
|
134 |
knowledge of the probability, whether the next pixel will be |
|
|
135 |
black or white. One single pixel out of this template of |
|
|
136 |
context neighbor pixels can be moved around. Especially for |
|
|
137 |
dithered images it can be a significant advantage to have |
|
|
138 |
one neighbor pixel which has a distance large enough to |
|
|
139 |
cover the period of a dither function. By default, the |
|
|
140 |
adaptive template pixel can be moved up to 8 pixels away. |
|
|
141 |
This encoder supports up to 23 pixels, however as decoders |
|
|
142 |
are only required to support at least a distance of 16 |
|
|
143 |
pixels by the standard, no higher value than 16 for |
|
|
144 |
''number'' is recommended in order to maintain |
|
|
145 |
interoperability with other ''JBIG'' implementations. The |
|
|
146 |
maximal vertical offset of the adaptive template pixel is |
|
|
147 |
always zero. |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
__-t__ ''number'' |
|
|
151 |
|
|
|
152 |
|
|
|
153 |
Encode only the specified number of most significant bit |
|
|
154 |
planes. This option allows to reduce the depth of an input |
|
|
155 |
PGM file if not all bits per pixel are needed in the |
|
|
156 |
output. |
|
|
157 |
|
|
|
158 |
|
|
|
159 |
__-o__ ''number'' |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
''JBIG'' separates an image into several horizontal |
|
|
163 |
stripes, resolution layers and planes, were each plane |
|
|
164 |
contains one bit per pixel. One single stripe in one plane |
|
|
165 |
and layer is encoded as a data unit called stripe data |
|
|
166 |
entity (SDE) inside the BIE. There are 12 different possible |
|
|
167 |
orders in which the SDEs can be stored inside the BIE and |
|
|
168 |
''number'' selects which one shall be used. The order of |
|
|
169 |
the SDEs is only relevant for applications that want to |
|
|
170 |
decode a ''JBIG'' file which has not yet completely |
|
|
171 |
arrived from e.g. a slow network connection. For instance |
|
|
172 |
some applications prefer that the outermost of the three |
|
|
173 |
loops (stripes, layers, planes) is over all layers so that |
|
|
174 |
all data of the lowest resolution layer is transmitted |
|
|
175 |
first. |
|
|
176 |
The following values for ''number'' select these loop |
|
|
177 |
arrangements for writing the SDEs (outermost loop |
|
|
178 |
first): |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
0 planes, layers, stripes |
|
|
182 |
2 layers, planes, stripes |
|
|
183 |
3 layers, stripes, planes |
|
|
184 |
4 stripes, planes, layers |
|
|
185 |
5 planes, stripes, layers |
|
|
186 |
6 stripes, layers, planes |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
All loops count starting with zero, however by adding 8 to |
|
|
190 |
the above order code, the layer loop can be reversed so that |
|
|
191 |
it counts down to zero and then higher resolution layers |
|
|
192 |
will be stored before lower layers. Default order is 3 which |
|
|
193 |
writes at first all planes of the first stripe and then |
|
|
194 |
completes layer 0 before continuing with the next layer and |
|
|
195 |
so on. |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
__-p__ ''number'' |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
This option allows to activate or deactivate various |
|
|
202 |
optional algorithms defined in the ''JBIG'' standard. |
|
|
203 |
Just add the numbers of the following options which you want |
|
|
204 |
to activate in order to get the ''number'' |
|
|
205 |
value: |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
4 deterministic prediction (DPON) |
|
|
209 |
8 layer 0 typical prediction (TPBON) |
|
|
210 |
16 diff. layer typ. pred. (TPDON) |
|
|
211 |
64 layer 0 two-line template (LRLTWO) |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Except for special applications (like communication with |
|
|
215 |
''JBIG'' subset implementations) and for debugging |
|
|
216 |
purposes you will normally not want to change anything here. |
|
|
217 |
The default is 28, which provides the best compression |
|
|
218 |
result. |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
__-c__ The adaptive template pixel movement is determined |
|
|
222 |
as suggested in annex C of the standard. By default the |
|
|
223 |
template change takes place directly in the next line which |
|
|
224 |
is most effective. However a few conformance test examples |
|
|
225 |
in the standard require the adaptive template change to be |
|
|
226 |
delayed until the first line of the next stripe. This option |
|
|
227 |
selects this special behavior, which is normally not |
|
|
228 |
required except in order to pass some conformance test |
|
|
229 |
suite. |
|
|
230 |
|
|
|
231 |
|
|
|
232 |
__-v__ After the BIE has been created, a few technical |
|
|
233 |
details of the created file will be listed (verbose |
|
|
234 |
mode). |
|
|
235 |
!!FORMATS |
|
|
236 |
|
|
|
237 |
|
|
|
238 |
Most of the format __pnmtojbig__ creates is defined by |
|
|
239 |
the ''JBIG'' standard. |
|
|
240 |
|
|
|
241 |
|
|
|
242 |
The standard, however, does not specify which values in the |
|
|
243 |
BIE mean white and which mean black. It contains a |
|
|
244 |
recommendation that for a single plane image zero mean |
|
|
245 |
background and one mean foreground, but the Netpbm formats |
|
|
246 |
have no concept of foreground and background. And the |
|
|
247 |
standard says nothing about values for multiple plane |
|
|
248 |
BIEs. |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
__pnmtojbig__ follows Markus Kuhn's implementation of the |
|
|
252 |
standard in the __pbmtojbg__ program that comes with his |
|
|
253 |
''JBIG'' library: If the BIE is a single plane BIE, zero |
|
|
254 |
means white and one means black. If it is a multiple plane |
|
|
255 |
BIE, zero means black and the maximal value is |
|
|
256 |
white. |
|
|
257 |
!!STANDARDS |
|
|
258 |
|
|
|
259 |
|
|
|
260 |
This program implements the ''JBIG'' image coding |
|
|
261 |
algorithm as specified in ISO/IEC 11544:1993 and ITU-T |
|
|
262 |
T.82(1993). |
|
|
263 |
!!AUTHOR |
|
|
264 |
|
|
|
265 |
|
|
|
266 |
__pnmtojbig__ is based on the ''JBIG'' library by |
|
|
267 |
Markus Kuhn, part of his __JBIG-KIT__ package. The |
|
|
268 |
__pbmtojbg__ program is part of the ''JBIG-KIT'' |
|
|
269 |
package. The most recent version of that library and tools |
|
|
270 |
set is freely available on the Internet from anonymous ftp |
|
|
271 |
server ftp.informatik.uni-erlangen.de in directory |
|
|
272 |
pub/doc/ISO/JBIG/. |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
__pnmtojbig__ is part of the Netpbm package of graphics |
|
|
276 |
tools. |
|
|
277 |
!!SEE ALSO |
|
|
278 |
|
|
|
279 |
|
|
|
280 |
pbm(5),pgm(5),jbigtopbm(1) |
|
|
281 |
!!LICENSE |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
If you use __pnmtojbig__, you are using various patents, |
|
|
285 |
particularly on its arithmetic encoding method, and in all |
|
|
286 |
probability you do not have a license from the patent owners |
|
|
287 |
to do so. |
|
|
288 |
---- |