{
    "mode": "man",
    "parameter": "pnmtofiasco",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pnmtofiasco/1/json",
    "generated": "2026-06-16T10:12:08Z",
    "synopsis": "pnmtofiasco [option]...  [filename]...",
    "sections": {
        "NAME": {
            "content": "pnmtofiasco - Convert a portable anymap to FIASCO compressed file\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pnmtofiasco [option]...  [filename]...\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pnmtofiasco  compresses  the named pbm, pgm, or ppm image files, or Standard Input if no file\nis named, and produces a FIASCO file on Standard Output.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "All option names may be abbreviated; for example, --optimize may be written --optim or --opt.\nFor  most  options a one letter short option is provided.  Mandatory or optional arguments to\nlong options are mandatory or optional for short options, too.  Both short and  long  options\nare case sensitive.\n\nThe basic options are:\n\n",
            "subsections": [
                {
                    "name": "-i --input-name=",
                    "content": "Compress  the  named  images,  not Standard Input.  If name is -, read Standard Input.\nname has to be either an image filename or a template of the form:\n\nprefix[start-end{+,-}step]suffix\n\nTemplates are useful when compressing video streams: e.g., if you specify the template\nimg0[12-01-2].pgm, then pnmtofiasco compresses the images img012.pgm, img010.pgm, ...,\nimg002.pgm.\n\nIf name is a relative path, pnmtofiasco searches for the image files  in  the  current\ndirectory  and  in  the (colon-separated) list of directories given by the environment\nvariable FIASCOIMAGES.\n\n",
                    "flag": "-i"
                },
                {
                    "name": "-o --output-name=",
                    "content": "Write FIASCO output to the named file, not to Standard Output.\n\nIf name is a relative path and the environment variable FIASCODATA is a  (colon-sepa‐\nrated)  list  of  directories,  then  pnmtofiasco  writes the output file to the first\n(writable) directory of this list. Otherwise, pnmtofiasco write it to the current  di‐\nrectory.\n\n",
                    "flag": "-o"
                },
                {
                    "name": "-q --quality=",
                    "content": "Set quality of compression to N.  Quality is 1 (worst) to 100 (best); default is 20.\n\n",
                    "flag": "-q"
                },
                {
                    "name": "-v --version",
                    "content": "Print pnmtofiasco version number, then exit.\n\n",
                    "flag": "-v",
                    "long": "--version"
                },
                {
                    "name": "-V --verbose",
                    "content": "Set  level of verbosity to N.  Level is 0 (no output at all), 1 (show progress meter),\nor 2 (show detailed compression statistics); default is 1.\n\n",
                    "flag": "-V",
                    "long": "--verbose"
                },
                {
                    "name": "-B --progress-meter",
                    "content": "Set type of progress-meter to N.  The following types are available; default is 1:\n\n0: no progress meter\n\n1: RPM style progress bar using 50 hash marks\n\n2: percentage meter\n\n",
                    "flag": "-B",
                    "long": "--progress-meter"
                },
                {
                    "name": "-f --config=",
                    "content": "Load parameter file name to initialize the options  of  pnmtofiasco.   See  file  sys‐‐\ntem.fiascorc  for  an  example of the syntax. Options of pnmtofiasco are set by any of\nthe following methods (in the specified order):\n\n1) Global ressource file /etc/system.fiascorc\n\n2) $HOME/.fiascorc\n\n3) command line\n\n4) --config=name\n\n",
                    "flag": "-f"
                },
                {
                    "name": "-h --info",
                    "content": "Print brief help, then exit.\n\n",
                    "flag": "-h",
                    "long": "--info"
                },
                {
                    "name": "-H --help",
                    "content": "Print detailed help, then exit.\n\n\nThe options for advanced users are:\n\n",
                    "flag": "-H",
                    "long": "--help"
                },
                {
                    "name": "-b --basis-name=",
                    "content": "Preload compression basis name into FIASCO. The basis name provides the  initial  com‐\npression  dictionary.   Either  use  one  of  the  files \"small.fco\", \"medium.fco\", or\n\"large.fco\" that come with pnmtofiasco or create a new ASCII basis file.\n\n",
                    "flag": "-b"
                },
                {
                    "name": "-z --optimize=",
                    "content": "N. Level is 0 (fastes) to 3 (slowest); default is 1. Be warned, the encoding time dra‐\nmatically  increased  when  N=2 or N=3 while the compression performance only slightly\nimproves.\n\n",
                    "flag": "-z"
                },
                {
                    "name": "-P --prediction",
                    "content": "Use additional predictive coding. If this optimization is enabled then  the  image  is\ncompressed  in  two  steps.  In the first step, a coarse approximation of the image is\ncomputed using large unichrome blocks. Finally, the delta image is  computed  and  the\nprediction error is approximated using the standard FIASCO algorithm.\n\n",
                    "flag": "-P",
                    "long": "--prediction"
                },
                {
                    "name": "-D --dictionary-size=",
                    "content": "Set  size  of  dictionary that is used when coding the luminance band to N; default is\n10000, i.e., the dictionary is not restricted.\n\n",
                    "flag": "-D"
                },
                {
                    "name": "-C --chroma-dictionary=",
                    "content": "Set size of dictionary that is used when coding chroma bands to N; default is 40.\n\n",
                    "flag": "-C"
                },
                {
                    "name": "-Q --chroma-qfactor=",
                    "content": "Reduce the quality of chroma band compression N-times with respect to the user defined\nquality q of the luminance band compression (--quality=q); default is 2.\n\n",
                    "flag": "-Q"
                },
                {
                    "name": "-t --tiling-exponent=",
                    "content": "Subdivide  the image into 2^N tiles prior coding; default is 4, i.e. the image is sub‐\ndivided into 16 tiles. The processing order of the individual tiles is defined by  the\noption --tiling-method=name.\n\n",
                    "flag": "-t"
                },
                {
                    "name": "-T --tiling-method=",
                    "content": "Order  the  individual image tiles (the image is subdivided into; see option --tiling-\nexponent=N) by method name; default is \"desc-variance\".\n\ndesc-variance: Tiles with small variances are processed first.\n\nasc-variance: Tiles with large variances are processed first.\n\ndesc-spiral: Tiles are process in spiral order starting in the middle.\n\nasc-spiral: Tiles are process in spiral order starting at the border.\n\n\n--rpf-mantissa=N\nUse N mantissa bits for quantized coefficients.\n\n\n--dc-rpf-mantissa=N\nUse N mantissa bits for quantized DC coefficients.\n\n\n--rpf-range=N\nCoefficients outside the quantization interval [-N,+N] are set to zero.\n\n\n--dc-rpf-range=N\nDC coefficients outside the quantization interval [-N,+N] are set to zero.\n\n\nAdditional options for video compression are:\n\n",
                    "flag": "-T"
                },
                {
                    "name": "-s --smooth=",
                    "content": "Smooth decompressed reference frames along  the  partitioning  borders  by  the  given\namount  N.  N  is 0 (no smoothing) to 100; default is 70. This factor is stored in the\nFIASCO file.\n\n",
                    "flag": "-s"
                },
                {
                    "name": "-m --min-level=",
                    "content": "Start prediction (motion compensated prediction or  additional  prediction)  on  block\nlevel  N; default is level 6. I.e., motion compensation is applied to all image blocks\nof at least 8x8 pixels (binary tree level N=6), 16x8 (N=7), 16x16 (N=8), etc.\n\n",
                    "flag": "-m"
                },
                {
                    "name": "-M --max-level=",
                    "content": "Stop prediction (motion compensated prediction  or  additional  prediction)  on  block\nlevel N; default is level 10. I.e., motion compensation is applied to all image blocks\nof at most 16x16 pixels (N=8), 32x16 (N=9), 32x32 (N=10), etc.\n\n",
                    "flag": "-M"
                },
                {
                    "name": "-2 --half-pixel",
                    "content": "Use half pixel precise motion compensation.\n\n",
                    "flag": "-2",
                    "long": "--half-pixel"
                },
                {
                    "name": "-F --fps=",
                    "content": "Set number of frames per second to N. This value is stored in the FIASCO  output  file\nand is used in the decoder dfiasco(1) to control the framerate.\n\n",
                    "flag": "-F"
                },
                {
                    "name": "-p --pattern=",
                    "content": "Defines  the  type  of  inter  frame compression which should be applied to individual\nframes of a video stream. type is a sequence of characters; default  is  \"IPPPPPPPPP\".\nElement  N  defines the type of predicting which should be used for frame N; the frame\ntype pattern is periodically extended. Valid characters are:\n\nI: intra frame, i.e., no motion compensated prediction is used at all.\n\nP: predicted frame, i.e., a previously encoded frame is used for  prediction  (forward\nprediction).\n\nB:  bidirectional  predicted frame, i.e., not only a previously shown frame but also a\nframe of the future is used for prediction (forward, backward or interpolated  predic‐\ntion).\n\n",
                    "flag": "-p"
                },
                {
                    "name": "--cross-B-search",
                    "content": "Instead  of using exhaustive search the \"Cross-B-Search\" algorithm is used to find the\nbest interpolated prediction of B-frames.\n\n",
                    "long": "--cross-B-search"
                },
                {
                    "name": "--B-as-past-ref",
                    "content": "Also use previously encoded B-frames when prediction the current frame. If this option\nis not set, only I- and P-frames are used to predict the current frame.\n\n",
                    "long": "--B-as-past-ref"
                }
            ]
        },
        "EXAMPLES": {
            "content": "pnmtofiasco < foo.ppm >foo.wfa\nCompress  the still image \"foo.ppm\" to the FIASCO file \"foo.wfa\" using the default op‐\ntions.\n\n\npnmtofiasco -2 -p \"IBBPBBPBB\" -fps 15 -o video.wfa foo0*.ppm\nCompress the video frames \"foo0*.ppm\" to the FIASCO file \"video.wfa\" using half  pixel\nprecise  motion compensation at a frame rate of 15 frames per second. Intra frame 1 is\nused to predict P-frame 4, frames 1 and 4 are used to predict B-frames 2 and 3, and so\non. Frame 10 is again an intra-frame.\n\n",
            "subsections": []
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "/etc/system.fiascorc",
                    "content": "The systemwide initialization file.\n$HOME/.fiascorc\nThe personal initialization file.\n\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "FIASCOIMAGES\nSearch path for image files. Default is \"./\".\nFIASCODATA\nSearch and save path for FIASCO files. Default is \"./\".\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fiascotopnm(1), ppmtojpeg(1), pnmtojbig(1), ppmtogif(1), pnm(5)\n\nUllrich  Hafner,  Juergen  Albert, Stefan Frank, and Michael Unger.  Weighted Finite Automata\nfor Video Compression, IEEE Journal on Selected Areas In Communications, January 1998\nUllrich Hafner. Low Bit-Rate Image and Video Coding with Weighted Finite Automata, Ph.D. the‐\nsis, Mensch & Buch Verlag, ISBN 3-89820-002-7, October 1999.\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Ullrich Hafner <hafner@bigfoot.de>\n\n\n\nJuly 12, 2000                            pnmmtofiasco(1)",
            "subsections": []
        }
    },
    "summary": "pnmtofiasco - Convert a portable anymap to FIASCO compressed file",
    "flags": [
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": "Compress the named images, not Standard Input. If name is -, read Standard Input. name has to be either an image filename or a template of the form: prefix[start-end{+,-}step]suffix Templates are useful when compressing video streams: e.g., if you specify the template img0[12-01-2].pgm, then pnmtofiasco compresses the images img012.pgm, img010.pgm, ..., img002.pgm. If name is a relative path, pnmtofiasco searches for the image files in the current directory and in the (colon-separated) list of directories given by the environment variable FIASCOIMAGES."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Write FIASCO output to the named file, not to Standard Output. If name is a relative path and the environment variable FIASCODATA is a (colon-sepa‐ rated) list of directories, then pnmtofiasco writes the output file to the first (writable) directory of this list. Otherwise, pnmtofiasco write it to the current di‐ rectory."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "Set quality of compression to N. Quality is 1 (worst) to 100 (best); default is 20."
        },
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "Print pnmtofiasco version number, then exit."
        },
        {
            "flag": "-V",
            "long": "--verbose",
            "arg": null,
            "description": "Set level of verbosity to N. Level is 0 (no output at all), 1 (show progress meter), or 2 (show detailed compression statistics); default is 1."
        },
        {
            "flag": "-B",
            "long": "--progress-meter",
            "arg": null,
            "description": "Set type of progress-meter to N. The following types are available; default is 1: 0: no progress meter 1: RPM style progress bar using 50 hash marks 2: percentage meter"
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Load parameter file name to initialize the options of pnmtofiasco. See file sys‐‐ tem.fiascorc for an example of the syntax. Options of pnmtofiasco are set by any of the following methods (in the specified order): 1) Global ressource file /etc/system.fiascorc 2) $HOME/.fiascorc 3) command line 4) --config=name"
        },
        {
            "flag": "-h",
            "long": "--info",
            "arg": null,
            "description": "Print brief help, then exit."
        },
        {
            "flag": "-H",
            "long": "--help",
            "arg": null,
            "description": "Print detailed help, then exit. The options for advanced users are:"
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "Preload compression basis name into FIASCO. The basis name provides the initial com‐ pression dictionary. Either use one of the files \"small.fco\", \"medium.fco\", or \"large.fco\" that come with pnmtofiasco or create a new ASCII basis file."
        },
        {
            "flag": "-z",
            "long": null,
            "arg": null,
            "description": "N. Level is 0 (fastes) to 3 (slowest); default is 1. Be warned, the encoding time dra‐ matically increased when N=2 or N=3 while the compression performance only slightly improves."
        },
        {
            "flag": "-P",
            "long": "--prediction",
            "arg": null,
            "description": "Use additional predictive coding. If this optimization is enabled then the image is compressed in two steps. In the first step, a coarse approximation of the image is computed using large unichrome blocks. Finally, the delta image is computed and the prediction error is approximated using the standard FIASCO algorithm."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": "Set size of dictionary that is used when coding the luminance band to N; default is 10000, i.e., the dictionary is not restricted."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "Set size of dictionary that is used when coding chroma bands to N; default is 40."
        },
        {
            "flag": "-Q",
            "long": null,
            "arg": null,
            "description": "Reduce the quality of chroma band compression N-times with respect to the user defined quality q of the luminance band compression (--quality=q); default is 2."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "Subdivide the image into 2^N tiles prior coding; default is 4, i.e. the image is sub‐ divided into 16 tiles. The processing order of the individual tiles is defined by the option --tiling-method=name."
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "Order the individual image tiles (the image is subdivided into; see option --tiling- exponent=N) by method name; default is \"desc-variance\". desc-variance: Tiles with small variances are processed first. asc-variance: Tiles with large variances are processed first. desc-spiral: Tiles are process in spiral order starting in the middle. asc-spiral: Tiles are process in spiral order starting at the border. --rpf-mantissa=N Use N mantissa bits for quantized coefficients. --dc-rpf-mantissa=N Use N mantissa bits for quantized DC coefficients. --rpf-range=N Coefficients outside the quantization interval [-N,+N] are set to zero. --dc-rpf-range=N DC coefficients outside the quantization interval [-N,+N] are set to zero. Additional options for video compression are:"
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Smooth decompressed reference frames along the partitioning borders by the given amount N. N is 0 (no smoothing) to 100; default is 70. This factor is stored in the FIASCO file."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Start prediction (motion compensated prediction or additional prediction) on block level N; default is level 6. I.e., motion compensation is applied to all image blocks of at least 8x8 pixels (binary tree level N=6), 16x8 (N=7), 16x16 (N=8), etc."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "Stop prediction (motion compensated prediction or additional prediction) on block level N; default is level 10. I.e., motion compensation is applied to all image blocks of at most 16x16 pixels (N=8), 32x16 (N=9), 32x32 (N=10), etc."
        },
        {
            "flag": "-2",
            "long": "--half-pixel",
            "arg": null,
            "description": "Use half pixel precise motion compensation."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "Set number of frames per second to N. This value is stored in the FIASCO output file and is used in the decoder dfiasco(1) to control the framerate."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Defines the type of inter frame compression which should be applied to individual frames of a video stream. type is a sequence of characters; default is \"IPPPPPPPPP\". Element N defines the type of predicting which should be used for frame N; the frame type pattern is periodically extended. Valid characters are: I: intra frame, i.e., no motion compensated prediction is used at all. P: predicted frame, i.e., a previously encoded frame is used for prediction (forward prediction). B: bidirectional predicted frame, i.e., not only a previously shown frame but also a frame of the future is used for prediction (forward, backward or interpolated predic‐ tion)."
        },
        {
            "flag": "",
            "long": "--cross-B-search",
            "arg": null,
            "description": "Instead of using exhaustive search the \"Cross-B-Search\" algorithm is used to find the best interpolated prediction of B-frames."
        },
        {
            "flag": "",
            "long": "--B-as-past-ref",
            "arg": null,
            "description": "Also use previously encoded B-frames when prediction the current frame. If this option is not set, only I- and P-frames are used to predict the current frame."
        }
    ],
    "examples": [
        "pnmtofiasco < foo.ppm >foo.wfa",
        "Compress  the still image \"foo.ppm\" to the FIASCO file \"foo.wfa\" using the default op‐",
        "tions.",
        "pnmtofiasco -2 -p \"IBBPBBPBB\" -fps 15 -o video.wfa foo0*.ppm",
        "Compress the video frames \"foo0*.ppm\" to the FIASCO file \"video.wfa\" using half  pixel",
        "precise  motion compensation at a frame rate of 15 frames per second. Intra frame 1 is",
        "used to predict P-frame 4, frames 1 and 4 are used to predict B-frames 2 and 3, and so",
        "on. Frame 10 is again an intra-frame."
    ],
    "see_also": [
        {
            "name": "fiascotopnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/fiascotopnm/1/json"
        },
        {
            "name": "ppmtojpeg",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppmtojpeg/1/json"
        },
        {
            "name": "pnmtojbig",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmtojbig/1/json"
        },
        {
            "name": "ppmtogif",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppmtogif/1/json"
        },
        {
            "name": "pnm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Convert a PNM image to a compressed FIASCO file.",
        "examples": [
            {
                "description": "Convert a PNM image to a compressed FIASCO file",
                "command": "pnmtofiasco {{path/to/file.pnm}} > {{path/to/file.fiasco}}"
            },
            {
                "description": "Specify the input files through a pattern",
                "command": "pnmtofiasco {{-i|--image-name}} \"{{img[01-09+1].pnm}}\" > {{path/to/file.fiasco}}"
            },
            {
                "description": "Specify the compression quality",
                "command": "pnmtofiasco {{-q|--quality}} {{quality_level}} {{path/to/file.pnm}} > {{path/to/file.fiasco}}"
            },
            {
                "description": "Load the options to be used from the specified configuration file",
                "command": "pnmtofiasco {{-f|--config}} {{path/to/fiascorc}} {{path/to/file.pnm}} > {{path/to/file.fiasco}}"
            }
        ]
    }
}