MAN page from CentOS 6 jbigkit-2.0-7.3.i686.rpm
Section: User Commands (1)
pbmtojbg - portable bitmap to JBIG1 file converter
| - [output-file
Reads in a portable bitmap (PBM)from a file or standardinput, compresses it, and outputs the image as aJBIG1
bi-level image entity (BIE) file.
JBIG1is a highly effective lossless compression algorithm forbi-level images (one bit per pixel), which is particularly suitablefor scanned document pages.
AJBIG1encoded image can be stored in several resolutions (progressive mode).These resolution layers can be stored all in one single BIE or theycan be stored in several separate BIE files.All resolution layers except the lowest one are stored merely asdifferences to the next lower resolution layer, because this requires lessspace than encoding the full image completely every time. Each resolutionlayer has twice the number of horizontal and vertical pixels thanthe next lower layer.JBIG1files can also store several bits per pixel as separate bitmap planes,andpbmtojbgcan read a PGM file and transform it into a multi-bitplane BIE.
- A single hyphen instead of an input file name will cause pbmtojbgto read the data from standard input instead from a file.
- Encode the image in one single resolution layer (sequential mode). Thisis usually the most efficient compression method. By default, the numberof resolution layers is chosen automatically such that the lowest layerimage is not larger than 640 × 480 pixels. This is a shortcut for-d 0.
- -x number
- Specify the maximal horizontal size of the lowest resolution layer.The default is 640 pixels.
- -y number
- Specify the maximal vertical size of the lowest resolution layer.The default is 480 pixels.
- -l number
- Select the lowest resolution layer that will be written to theBIE. It is possible to store the various resolution layers of a JBIG1image in progressive mode into different BIEs. Options-land-hallow to select the resolution-layer interval that will appearin the created BIE. The lowest resolution layer has number 0 andthis is also the default value. By default all layers will be written.
- -h number
- Select the highest resolution layer that will be written to theBIE. By default all layers will be written. See also option-l.
- Use binary values instead of Gray code words in order to encode pixelvalues in multiple bitplanes. This option has only an effect if theinput is a PGM file and if more than one bitplane is produced. Notethat the decoder has to make the same selection but cannot determinefrom the BIE, whether Gray or binary code words were used by theencoder.
- -d number
- Specify the total number of differential resolution layers into which theinput image will be split in addition to the lowest layer. Each additionallayer reduces the size of layer 0 by 50 %. This option overrides options-xand-ywhich are usually a more comfortable way of selecting the number ofresolution layers.
- -s number
- TheJBIG1algorithm splits each image into a number of horizontal stripes. Thisoption specifies that each stripe shall havenumberlines in layer 0. The default value is selected so that approximately35 stripes will be used for the whole image.
- -m number
- Select the maximum horizontal offset of the adaptive template pixel.TheJBIG1encoder uses ten neighbour pixels to estimate the probability of thenext pixel being black or white. It can move one out of these tenpixels. This is especially useful for dithered images, as long as thedistance of this adaptive pixel can be adjusted to the period of thedither pattern. By default, the adaptive template pixel is allowed tomove up to 8 pixels away horizontally. This encoder supports distancesup to 127 pixels. Annex A of the standard suggests that decodersshould support at least a horizontal distance of 16 pixels, so usingvalues not higher than 16 fornumbermight increase the chances of interoperability with otherJBIG1implementations. On the other hand, the T.85 fax application profilerequires decoders to support horizontal offsets up to 127 pixels,which the maximum value permitted by the standard. (The maximalvertical offset of the adaptive template pixel is always zero for thisencoder.)
- -t number
- Encode only the specified number of most significant bit planes. Thisoption allows to reduce the depth of an input PGM file if not allbits per pixel are needed in the output.
- -o number
- JBIG1separates an image into several horizontal stripes, resolution layersand planes, were each plane contains one bit per pixel. One singlestripe in one plane and layer is encoded as a data unit called stripedata entity (SDE) inside the BIE. There are 12 different possibleorders in which the SDEs can be stored inside the BIE andnumberselects which one shall be used. The order of the SDEs is only relevantfor applications that want to decode aJBIG1file which has not yet completely arrived from e.g. a slow network connection.For instance some applications prefer that the outermost of the three loops(stripes, layers, planes) is over all layers so that all data of the lowestresolution layer is transmitted first.
The following values fornumberselect these loop arrangements for writing the SDEs (outermostloop first):
0 planes, layers, stripes
2 layers, planes, stripes
3 layers, stripes, planes
4 stripes, planes, layers
5 planes, stripes, layers
6 stripes, layers, planes
All loops count starting with zero, however by adding 8 to the aboveorder code, the layer loop can be reversed so that it counts down to zeroand then higher resolution layers will be stored before lower layers.Default order is 3 which writes at first all planes of the firststripe and then completes layer 0 before continuing with the nextlayer and so on.
- -p number
- This option allows to activate or deactivate various optional algorithmsdefined in theJBIG1standard. Just add the numbers of the following options which you want toactivate inorder to get thenumbervalue:
4 deterministic prediction (DPON)
8 layer 0 typical prediction (TPBON)
16 diff. layer typ. pred. (TPDON)
64 layer 0 two-line template (LRLTWO)
Except for special applications (like communication withJBIG1subset implementations) and for debugging purposes you will normallynot want to change anything here. The default is 28, which providesthe best compression result.
- -C string
- Add thestringin a comment marker segment to the produced data stream. (There is nosupport at present for adding comments that contain the zero byte.)
- Determine the adaptive template pixel movement as suggested in annex Cof the standard. By default the template change takes place directlyin the next line, which is most effective. However, a few conformancetest examples in the standard require the adaptive template change tobe delayed until the first line of the next stripe. This optionselects this special behavior, which is normally not required exceptin order to pass some conformance tests.
- Use the SDRST marker instead of the normal SDNORM marker. The probablyonly useful application of this option is to generate test data forchecking whether aJBIG1decoder has implemented SDRST correctly. In a normalJBIG1data stream, each stripe data entity (SDE) is terminated by an SDNORMmarker, which preserves the state of the arithmetic encoder (and more)for the next stripe in the same layer. The alternative SDRST markerresets this state at the end of the stripe.
- -Y number
- A long time ago, there were fax machines that couldn't even hold asingle page in memory. They had to start transmitting data before thepage was scanned in completely and the length of the image was known.The authors of the standard added a rather ugly hack to the otherwisebeautiful JBIG1 format to support this. The NEWLEN marker segment canoverride the image height stated in the BIE header anywhere later inthe data stream. Normallypbmtojbgnever generates NEWLEN marker segments, as it knows the correct imageheight when it outputs the header. This option is solely intended forthe purpose of generating test files with NEWLEN marker segments. Itcan be used to specify a higher initial image height for use in theBIE header, andpbmtojbgwill then add a NEWLEN marker segment at the latest possibleopportunity to the data stream to signal the correct final height.
- This option makes the output file comply to the "facsimile applicationprofile" defined in ITU-T Recommendation T.85. It is a shortcut for-q -o 0 -p 8 -s 128 -t 1 -m 127.
- After the BIE has been created, a few technical details of the createdfile will be listed (verbose mode).
Using standard input and standard output for binary data works only onsystems where there is no difference between binary and text streams(e.g., Unix). On other systems (e.g., MS-DOS), using standard input orstandard output may cause control characters like CR or LF to beinserted or deleted and this will damage the binary data.
This program implements theJBIG1
image coding algorithm as specified in ISO/IEC 11544:1993 andITU-T T.82(1993).
program is part of the JBIG-KIT
package, which has been developed by Markus Kuhn.The most recent version of thisportableJBIG1
library and tools set is available from<http://www.cl.cam.ac.uk/~mgk25/jbigkit/
- SEE ALSO
This document was created byman2html,using the manual pages.