{
    "mode": "man",
    "parameter": "pnmtojbig",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pnmtojbig/1/json",
    "generated": "2026-09-04T14:48:16Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "pnmtojbig - PNM to JBIG file converter\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "pnmtojbig",
                    "content": "[options] [input-file [output-file]]\n\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\npnmtojbig  reads  a PBM or PGM image, compresses it, and outputs the image as a JBIG bi-level\nimage entity (BIE) file.\n\nJBIG is a highly effective lossless compression algorithm for bi-level images  (one  bit  per\npixel), which is particularly suitable for scanned document pages.\n\nA  JBIG encoded image can be stored in several resolutions (progressive mode).  These resolu‐\ntion layers can be stored all in one single BIE or they can be stored in several separate BIE\nfiles.  All resolution layers except the lowest one are stored merely as differences  to  the\nnext  lower  resolution  layer, because this requires less space than encoding the full image\ncompletely every time. Each resolution layer has twice the number of horizontal and  vertical\npixels  than the next lower layer.  JBIG files can also store several bits per pixel as sepa‐\nrate bitmap planes, and pnmtojbig can read a PGM file and transform it into a  multi-bitplane\nBIE.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), pnmtojbig recognizes the following command line options:\n\n\n\n",
            "subsections": [
                {
                    "name": "-q",
                    "content": "most efficient compression method. By default, the number of resolution layers is cho‐\nsen automatically such that the lowest layer image is not larger than 640 ×  480  pix‐\nels.\n\n",
                    "flag": "-q"
                },
                {
                    "name": "-x _",
                    "content": "Specify  the  maximal  horizontal size of the lowest resolution layer.  The default is\n640 pixels.\n\n",
                    "flag": "-x"
                },
                {
                    "name": "-y _",
                    "content": "Specify the maximal vertical size of the lowest resolution layer.  The default is  480\npixels.\n\n",
                    "flag": "-y"
                },
                {
                    "name": "-l _",
                    "content": "Select the lowest resolution layer that will be written to the BIE.  It is possible to\nstore the various resolution layers of a JBIG image in progressive mode into different\nBIEs.   Options  -l and -h allow you to select the resolution-layer interval that will\nappear in the created BIE.  The lowest resolution layer has number 0 and this is  also\nthe default value.  By default, pnmtojbig writes all layers.\n\n",
                    "flag": "-l"
                },
                {
                    "name": "-h _",
                    "content": "Select the highest resolution layer that will be written to the BIE.  By default, pnm‐\ntojbig writes all layers.  See also option -l.\n\n",
                    "flag": "-h"
                },
                {
                    "name": "-b",
                    "content": "ple  bitplanes.  This option has only an effect if the input is a PGM file and if more\nthan one bitplane is produced. Note that the decoder has to make  the  same  selection\nbut  cannot determine from the BIE, whether Gray or binary code words were used by the\nencoder.\n\n",
                    "flag": "-b"
                },
                {
                    "name": "-d _",
                    "content": "Specify the total number of differential resolution layers into which the input  image\nwill be split in addition to the lowest layer.  Each additional layer reduces the size\nof layer 0 by 50 %.  This option overrides options -x and -y, which are usually a more\ncomfortable way of selecting the number of resolution layers.\n\n",
                    "flag": "-d"
                },
                {
                    "name": "-s _",
                    "content": "The JBIG algorithm splits each image into a number of horizontal stripes.  This option\nspecifies  that  each stripe shall have number lines in layer 0.  The default value is\nselected so that approximately 35 stripes will be used for the whole image.\n\n",
                    "flag": "-s"
                },
                {
                    "name": "-m _",
                    "content": "Select the maximum horizontal offset of the adaptive template pixel.  The JBIG encoder\nuses a number of neighbour pixels in order to get statistical a  priori  knowledge  of\nthe  probability, whether the next pixel will be black or white.  One single pixel out\nof this template of context neighbor pixels  can  be  moved  around.   Especially  for\ndithered images it can be a significant advantage to have one neighbor pixel which has\na  distance  large  enough  to cover the period of a dither function.  By default, the\nadaptive template pixel can be moved up to 8 pixels away.  This encoder go  up  to  23\npixels, however as decoders are only required to handle at least a distance of 16 pix‐\nels  by  the  standard,  no higher value than 16 for number is recommended in order to\nmaintain interoperability with other JBIG implementations.  The maximal vertical  off‐\nset of the adaptive template pixel is always zero.\n\n",
                    "flag": "-m"
                },
                {
                    "name": "-t _",
                    "content": "Encode  only  the specified number of most significant bit planes.  This option allows\none to reduce the depth of an input PGM file if not all bits per pixel are  needed  in\nthe output.\n\n",
                    "flag": "-t"
                },
                {
                    "name": "-o _",
                    "content": "JBIG separates an image into several horizontal stripes, resolution layers and planes,\nwere  each plane contains one bit per pixel.  One single stripe in one plane and layer\nis encoded as a data unit called stripe data entity (SDE) inside the BIE.   There  are\n12 different possible orders in which the SDEs can be stored inside the BIE and number\nselects  which one shall be used.  The order of the SDEs is only relevant for applica‐\ntions that want to decode a JBIG file which has not yet completely arrived from e.g. a\nslow network connection.  For instance some applications prefer that the outermost  of\nthe  three  loops (stripes, layers, planes) is over all layers so that all data of the\nlowest resolution layer is transmitted first.\n\nThe following values for number select these loop arrangements for  writing  the  SDEs\n(outermost loop first):\n\n\n\n0      planes, layers, stripes\n\n\n2      layers, planes, stripes\n\n\n3      layers, stripes, planes\n\n\n4      stripes, planes, layers\n\n\n5      planes, stripes, layers\n\n\n6      stripes, layers, planes\n\n\n\nAll  loops  count starting with zero, however by adding 8 to the above order code, the\nlayer loop can be reversed so that it counts down to zero and then  higher  resolution\nlayers  will  be stored before lower layers.  Default order is 3 which writes at first\nall planes of the first stripe and then completes layer 0 before continuing  with  the\nnext layer and so on.\n\n",
                    "flag": "-o"
                },
                {
                    "name": "-p _",
                    "content": "This  option  allows you to activate or deactivate various optional algorithms defined\nin the JBIG standard.  Just add the numbers of the following options which you want to\nactivate in order to get the number value:\n\n\n\n4      deterministic prediction (DPON)\n\n\n8      typical prediction (TPBON)\n\n\n16     diff. layer typical prediction (TPDON)\n\n\n64     layer 0 two-line template (LRLTWO)\n\n\n\nExcept for special applications (like communication with JBIG subset  implementations)\nand  for  debugging  purposes you will normally not want to change anything here.  The\ndefault is 28, which provides the best compression result.\n\n",
                    "flag": "-p"
                },
                {
                    "name": "-c",
                    "content": "standard.   By default the template change takes place directly in the next line which\nis most effective.  However a few conformance test examples in  the  standard  require\nthe  adaptive  template  change to be delayed until the first line of the next stripe.\nThis option selects this special behavior, which is normally not  required  except  in\norder to pass some conformance test suite.\n\n",
                    "flag": "-c"
                },
                {
                    "name": "-v",
                    "content": "(verbose mode).\n\n\n\n",
                    "flag": "-v"
                }
            ]
        },
        "FORMATS": {
            "content": "Most of the format pnmtojbig creates is defined by the JBIG standard.\n\nThe standard, however, does not specify which values in the BIE mean  white  and  which  mean\nblack.   It  contains a recommendation that for a single plane image zero mean background and\none mean foreground, but the Netpbm formats have no concept  of  foreground  and  background.\nAnd the standard says nothing about values for multiple plane BIEs.\n\npnmtojbig  follows  Markus Kuhn's implementation of the standard in the pbmtojbg program that\ncomes with his JBIG library:  If the BIE is a single plane BIE,  zero  means  white  and  one\nmeans black.  If it is a multiple plane BIE, zero means black and the maximal value is white.\n\n",
            "subsections": []
        },
        "STANDARDS": {
            "content": "This  program  implements  the JBIG image coding algorithm as specified in ISO/IEC 11544:1993\nand ITU-T T.82(1993).\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "pnmtojbig is based on the JBIG library by Markus Kuhn, part of  his  JBIG-KIT  package.   The\npbmtojbg  program  is  part of the JBIG-KIT package.  The most recent version of that library\nand tools set is freely available on  the  Internet  from  anonymous  ftp  server  \u001b]8;;ftp://ftp.informatik.uni-erlangen.de\u001b\\ftp.infor‐\nmatik.uni-erlangen.de\u001b]8;;\u001b\\  in directory pub/doc/ISO/JBIG/.\n\npnmtojbig is part of the Netpbm package of graphics tools.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pnm(1), jbigtopnm(1)\n\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "There  was  at  one time concern about the need for patent licenses to use pnmtojbig, but any\nrelevant patents expired by 2012.\n",
            "subsections": []
        },
        "DOCUMENT SOURCE": {
            "content": "This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pnmtojbig.html\n\nnetpbm documentation                        28 July 2020                    Pnmtojbig User Manual(1)",
            "subsections": []
        }
    },
    "summary": "pnmtojbig - PNM to JBIG file converter",
    "flags": [
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "most efficient compression method. By default, the number of resolution layers is cho‐ sen automatically such that the lowest layer image is not larger than 640 × 480 pix‐ els."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "Specify the maximal horizontal size of the lowest resolution layer. The default is 640 pixels."
        },
        {
            "flag": "-y",
            "long": null,
            "arg": null,
            "description": "Specify the maximal vertical size of the lowest resolution layer. The default is 480 pixels."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "Select the lowest resolution layer that will be written to the BIE. It is possible to store the various resolution layers of a JBIG image in progressive mode into different BIEs. Options -l and -h allow you to select the resolution-layer interval that will appear in the created BIE. The lowest resolution layer has number 0 and this is also the default value. By default, pnmtojbig writes all layers."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "Select the highest resolution layer that will be written to the BIE. By default, pnm‐ tojbig writes all layers. See also option -l."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "ple bitplanes. This option has only an effect if the input is a PGM file and if more than one bitplane is produced. Note that the decoder has to make the same selection but cannot determine from the BIE, whether Gray or binary code words were used by the encoder."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Specify the total number of differential resolution layers into which the input image will be split in addition to the lowest layer. Each additional layer reduces the size of layer 0 by 50 %. This option overrides options -x and -y, which are usually a more comfortable way of selecting the number of resolution layers."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "The JBIG algorithm splits each image into a number of horizontal stripes. This option specifies that each stripe shall have number lines in layer 0. The default value is selected so that approximately 35 stripes will be used for the whole image."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Select the maximum horizontal offset of the adaptive template pixel. The JBIG encoder uses a number of neighbour pixels in order to get statistical a priori knowledge of the probability, whether the next pixel will be black or white. One single pixel out of this template of context neighbor pixels can be moved around. Especially for dithered images it can be a significant advantage to have one neighbor pixel which has a distance large enough to cover the period of a dither function. By default, the adaptive template pixel can be moved up to 8 pixels away. This encoder go up to 23 pixels, however as decoders are only required to handle at least a distance of 16 pix‐ els by the standard, no higher value than 16 for number is recommended in order to maintain interoperability with other JBIG implementations. The maximal vertical off‐ set of the adaptive template pixel is always zero."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Encode only the specified number of most significant bit planes. This option allows one to reduce the depth of an input PGM file if not all bits per pixel are needed in the output."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "JBIG separates an image into several horizontal stripes, resolution layers and planes, were each plane contains one bit per pixel. One single stripe in one plane and layer is encoded as a data unit called stripe data entity (SDE) inside the BIE. There are 12 different possible orders in which the SDEs can be stored inside the BIE and number selects which one shall be used. The order of the SDEs is only relevant for applica‐ tions that want to decode a JBIG file 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 lowest resolution layer is transmitted first. The following values for number select these loop arrangements for writing the SDEs (outermost loop 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 above order code, the layer loop can be reversed so that it counts down to zero and then higher resolution layers will be stored before lower layers. Default order is 3 which writes at first all planes of the first stripe and then completes layer 0 before continuing with the next layer and so on."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "This option allows you to activate or deactivate various optional algorithms defined in the JBIG standard. Just add the numbers of the following options which you want to activate in order to get the number value: 4 deterministic prediction (DPON) 8 typical prediction (TPBON) 16 diff. layer typical prediction (TPDON) 64 layer 0 two-line template (LRLTWO) Except for special applications (like communication with JBIG subset implementations) and for debugging purposes you will normally not want to change anything here. The default is 28, which provides the best compression result."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "standard. By default the template change takes place directly in the next line which is most effective. However a few conformance test examples in the standard require the adaptive template change to be delayed until the first line of the next stripe. This option selects this special behavior, which is normally not required except in order to pass some conformance test suite."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "(verbose mode)."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
        },
        {
            "name": "jbigtopnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jbigtopnm/1/json"
        }
    ]
}