1Pnmtojbig User Manual(0)                              Pnmtojbig User Manual(0)
2
3
4

NAME

6       pnmtojbig - PNM to JBIG file converter
7
8

SYNOPSIS

10       pnmtojbig
11
12       [options] [input-file [output-file]]
13
14

DESCRIPTION

16       This program is part of Netpbm(1).
17
18       pnmtojbig  reads  a  PBM  or  PGM image, compresses it, and outputs the
19       image as a JBIG bi-level image entity (BIE) file.
20
21       JBIG is a highly effective lossless compression algorithm for  bi-level
22       images  (one bit per pixel), which is particularly suitable for scanned
23       document pages.
24
25       A JBIG encoded image can be stored in several resolutions  (progressive
26       mode).   These resolution layers can be stored all in one single BIE or
27       they can be stored in several separate BIE files.  All resolution  lay‐
28       ers  except the lowest one are stored merely as differences to the next
29       lower resolution layer, because this requires less space than  encoding
30       the  full  image completely every time. Each resolution layer has twice
31       the number of horizontal and vertical pixels than the next lower layer.
32       JBIG  files  can  also  store several bits per pixel as separate bitmap
33       planes, and pnmtojbig can read a PGM  file  and  transform  it  into  a
34       multi-bitplane BIE.
35
36

OPTIONS

38       In  addition  to  the options common to all programs based on libnetpbm
39       (most notably -quiet, see
40        Common Options ⟨index.html#commonoptions⟩ ), pnmtojbig recognizes  the
41       following command line options:
42
43
44
45
46       -q     Encode  the  image  in  one  single resolution layer (sequential
47              mode). This is usually the most efficient compression method. By
48              default, the number of resolution layers is chosen automatically
49              such that the lowest layer image is not larger than  640  ×  480
50              pixels.
51
52
53       -x number
54              Specify  the  maximal  horizontal  size of the lowest resolution
55              layer.  The default is 640 pixels.
56
57
58       -y number
59              Specify the maximal  vertical  size  of  the  lowest  resolution
60              layer.  The default is 480 pixels.
61
62
63       -l number
64              Select  the  lowest resolution layer that will be written to the
65              BIE.  It is possible to store the various resolution layers of a
66              JBIG  image in progressive mode into different BIEs.  Options -l
67              and -h allow you to select the  resolution-layer  interval  that
68              will appear in the created BIE.  The lowest resolution layer has
69              number 0 and this is also the default value.  By default, pnmto‐
70              jbig writes all layers.
71
72
73       -h number
74              Select  the highest resolution layer that will be written to the
75              BIE.  By default, pnmtojbig writes all layers.  See also  option
76              -l.
77
78
79       -b     Use  binary values instead of Gray code words in order to encode
80              pixel values in multiple bitplanes.  This  option  has  only  an
81              effect  if the input is a PGM file and if more than one bitplane
82              is produced. Note that the decoder has to make the  same  selec‐
83              tion  but  cannot determine from the BIE, whether Gray or binary
84              code words were used by the encoder.
85
86
87       -d number
88              Specify the total number of differential resolution layers  into
89              which  the  input  image will be split in addition to the lowest
90              layer.  Each additional layer reduces the size of layer 0 by  50
91              %.  This option overrides options -x and -y, which are usually a
92              more comfortable way of selecting the number of resolution  lay‐
93              ers.
94
95
96       -s number
97              The JBIG algorithm splits each image into a number of horizontal
98              stripes.  This option specifies that each stripe shall have num‐
99              ber  lines  in  layer  0.  The default value is selected so that
100              approximately 35 stripes will be used for the whole image.
101
102
103       -m number
104              Select the maximum horizontal offset of  the  adaptive  template
105              pixel.   The  JBIG  encoder uses a number of neighbour pixels in
106              order to get statistical a priori knowledge of the  probability,
107              whether the next pixel will be black or white.  One single pixel
108              out of this template of context neighbor  pixels  can  be  moved
109              around.   Especially for dithered images it can be a significant
110              advantage to have one neighbor pixel which has a distance  large
111              enough  to  cover  the period of a dither function.  By default,
112              the adaptive template pixel can be moved up to  8  pixels  away.
113              This  encoder  go  up to 23 pixels, however as decoders are only
114              required to handle at least a distance of 16 pixels by the stan‐
115              dard, no higher value than 16 for number is recommended in order
116              to maintain interoperability with  other  JBIG  implementations.
117              The  maximal  vertical  offset of the adaptive template pixel is
118              always zero.
119
120
121       -t number
122              Encode only the specified number of most significant bit planes.
123              This  option  allows to reduce the depth of an input PGM file if
124              not all bits per pixel are needed in the output.
125
126
127       -o number
128              JBIG separates an image into several horizontal stripes, resolu‐
129              tion  layers  and  planes,  were each plane contains one bit per
130              pixel.  One single stripe in one plane and layer is encoded as a
131              data unit called stripe data entity (SDE) inside the BIE.  There
132              are 12 different possible orders in which the SDEs can be stored
133              inside  the BIE and number selects which one shall be used.  The
134              order of the SDEs is only relevant for applications that want to
135              decode  a  JBIG  file  which has not yet completely arrived from
136              e.g. a slow network connection.  For instance some  applications
137              prefer  that  the outermost of the three loops (stripes, layers,
138              planes) is over all layers so that all data of the lowest  reso‐
139              lution layer is transmitted first.
140
141              The  following  values for number select these loop arrangements
142              for writing the SDEs (outermost loop first):
143
144
145
146       0      planes, layers, stripes
147
148
149       2      layers, planes, stripes
150
151
152       3      layers, stripes, planes
153
154
155       4      stripes, planes, layers
156
157
158       5      planes, stripes, layers
159
160
161       6      stripes, layers, planes
162
163
164
165              All loops count starting with zero, however by adding 8  to  the
166              above  order  code,  the  layer  loop can be reversed so that it
167              counts down to zero and then higher resolution  layers  will  be
168              stored  before lower layers.  Default order is 3 which writes at
169              first all planes of the first stripe and then completes layer  0
170              before continuing with the next layer and so on.
171
172
173       -p number
174              This  option  allows  you  to  activate  or  deactivate  various
175              optional algorithms defined in the JBIG standard.  Just add  the
176              numbers  of  the following options which you want to activate in
177              order to get the number value:
178
179
180
181       4      deterministic prediction (DPON)
182
183
184       8      typical prediction (TPBON)
185
186
187       16     diff. layer typical prediction (TPDON)
188
189
190       64     layer 0 two-line template (LRLTWO)
191
192
193
194              Except for special applications (like  communication  with  JBIG
195              subset implementations) and for debugging purposes you will nor‐
196              mally not want to change anything  here.   The  default  is  28,
197              which provides the best compression result.
198
199
200       -c     The  adaptive template pixel movement is determined as suggested
201              in annex C of the standard.   By  default  the  template  change
202              takes  place  directly in the next line which is most effective.
203              However a few conformance test examples in the standard  require
204              the  adaptive template change to be delayed until the first line
205              of the next stripe.  This option selects this special  behavior,
206              which is normally not required except in order to pass some con‐
207              formance test suite.
208
209
210       -v     After pnmtojbig creates  the  BIE,  it  lists  a  few  technical
211              details of the created file (verbose mode).
212
213
214
215

FORMATS

217       Most of the format pnmtojbig creates is defined by the JBIG standard.
218
219       The  standard,  however,  does not specify which values in the BIE mean
220       white and which mean black.  It contains a recommendation  that  for  a
221       single  plane  image  zero mean background and one mean foreground, but
222       the Netpbm formats have no concept of foreground and  background.   And
223       the standard says nothing about values for multiple plane BIEs.
224
225       pnmtojbig  follows  Markus Kuhn's implementation of the standard in the
226       pbmtojbg program that comes with his JBIG library:  If  the  BIE  is  a
227       single  plane  BIE,  zero  means white and one means black.  If it is a
228       multiple plane BIE, zero means black and the maximal value is white.
229
230

STANDARDS

232       This program implements the JBIG image coding algorithm as specified in
233       ISO/IEC 11544:1993 and ITU-T T.82(1993).
234
235

AUTHOR

237       pnmtojbig  is  based  on  the  JBIG library by Markus Kuhn, part of his
238       JBIG-KIT package.  The pbmtojbg program is part of the  JBIG-KIT  pack‐
239       age.   The  most recent version of that library and tools set is freely
240       available on the Internet from anonymous ftp server ftp.informatik.uni-
241       erlangen.de   ⟨ftp://ftp.informatik.uni-erlangen.de⟩      in  directory
242       pub/doc/ISO/JBIG/.
243
244       pnmtojbig is part of the Netpbm package of graphics tools.
245
246

SEE ALSO

248       pnm(1), jbigtopnm(1)
249
250

LICENSE

252       There was at one time concern about the need for patent licenses to use
253       pnmtojbig, but any relevant patents expired by 2012.
254

DOCUMENT SOURCE

256       This  manual  page was generated by the Netpbm tool 'makeman' from HTML
257       source.  The master documentation is at
258
259              http://netpbm.sourceforge.net/doc/pnmtojbig.html
260
261netpbm documentation             28 July 2020         Pnmtojbig User Manual(0)
Impressum