# phpman > man > pnmtofiasco(1)

> **TLDR:** Convert a PNM image to a compressed FIASCO file.
>
- Convert a PNM image to a compressed FIASCO file:
  `pnmtofiasco {{path/to/file.pnm}} > {{path/to/file.fiasco}}`
- Specify the input files through a pattern:
  `pnmtofiasco {{-i|--image-name}} "{{img[01-09+1].pnm}}" > {{path/to/file.fiasco}}`
- Specify the compression quality:
  `pnmtofiasco {{-q|--quality}} {{quality_level}} {{path/to/file.pnm}} > {{path/to/file.fiasco}}`
- Load the options to be used from the specified configuration file:
  `pnmtofiasco {{-f|--config}} {{path/to/fiascorc}} {{path/to/file.pnm}} > {{path/to/file.fiasco}}`

*Source: tldr-pages*

---

[pnmmtofiasco(1)](https://www.chedong.com/phpMan.php/man/pnmmtofiasco/1/markdown)                        General Commands Manual                       [pnmmtofiasco(1)](https://www.chedong.com/phpMan.php/man/pnmmtofiasco/1/markdown)



## NAME
       pnmtofiasco - Convert a portable anymap to FIASCO compressed file


## SYNOPSIS
       **pnmtofiasco** [_option_]...  [_filename_]...


## DESCRIPTION
       **pnmtofiasco**  compresses  the named pbm, pgm, or ppm image files, or Standard Input if no file
       is named, and produces a FIASCO file on Standard Output.


## OPTIONS
       All option names may be abbreviated; for example, --optimize may be written --optim or --opt.
       For  most  options a one letter short option is provided.  Mandatory or optional arguments to
       long options are mandatory or optional for short options, too.  Both short and  long  options
       are case sensitive.

       The basic options are:


### -i --input-name=
              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 **FIASCO**___**IMAGES**.


### -o --output-name=
              Write FIASCO output to the named file, not to Standard Output.

              If _name_ is a relative path and the environment variable **FIASCO**___**DATA** 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.


### -q --quality=
              Set quality of compression to _N_.  Quality is 1 (worst) to 100 (best); default is 20.


### -v --version
              Print **pnmtofiasco** version number, then exit.


### -V --verbose
              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.


### -B --progress-meter
              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


### -f --config=
              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_


### -h --info
              Print brief help, then exit.


### -H --help
              Print detailed help, then exit.


       The options for advanced users are:


### -b --basis-name=
              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.


### -z --optimize=
              _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.


### -P --prediction
              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.


### -D --dictionary-size=
              Set  size  of  dictionary that is used when coding the luminance band to _N_; default is
              10000, i.e., the dictionary is not restricted.


### -C --chroma-dictionary=
              Set size of dictionary that is used when coding chroma bands to _N_; default is 40.


### -Q --chroma-qfactor=
              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.


### -t --tiling-exponent=
              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_**.**


### -T --tiling-method=
              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:


### -s --smooth=
              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.


### -m --min-level=
              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.


### -M --max-level=
              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.


### -2 --half-pixel
              Use half pixel precise motion compensation.


### -F --fps=
              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)](https://www.chedong.com/phpMan.php/man/dfiasco/1/markdown) to control the framerate.


### -p --pattern=
              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).


### --cross-B-search
              Instead  of using exhaustive search the "Cross-B-Search" algorithm is used to find the
              best interpolated prediction of B-frames.


### --B-as-past-ref
              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.


## FILES
### /etc/system.fiascorc
              The systemwide initialization file.
       $HOME**/.fiascorc**
              The personal initialization file.


## ENVIRONMENT
       **FIASCO**___**IMAGES**
              Search path for image files. Default is "./".
       **FIASCO**___**DATA**
              Search and save path for FIASCO files. Default is "./".


## SEE ALSO
       [**fiascotopnm**(1)](https://www.chedong.com/phpMan.php/man/fiascotopnm/1/markdown), [**ppmtojpeg**(1)](https://www.chedong.com/phpMan.php/man/ppmtojpeg/1/markdown), [**pnmtojbig**(1)](https://www.chedong.com/phpMan.php/man/pnmtojbig/1/markdown), [**ppmtogif**(1)](https://www.chedong.com/phpMan.php/man/ppmtogif/1/markdown), [**pnm**(5)](https://www.chedong.com/phpMan.php/man/pnm/5/markdown)

       Ullrich  Hafner,  Juergen  Albert, Stefan Frank, and Michael Unger.  **Weighted** **Finite** **Automata**
       **for** **Video** **Compression**, IEEE Journal on Selected Areas In Communications, January 1998
       Ullrich Hafner. **Low** **Bit-Rate** **Image** **and** **Video** **Coding** **with** **Weighted** **Finite** **Automata**, Ph.D. the‐
       sis, Mensch & Buch Verlag, ISBN 3-89820-002-7, October 1999.


## AUTHOR
       Ullrich Hafner <<hafner@bigfoot.de>>



                                            July 12, 2000                            [pnmmtofiasco(1)](https://www.chedong.com/phpMan.php/man/pnmmtofiasco/1/markdown)
