| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 |
<html><head><title>Pnmtofiasco User Manual</title></head> |
| 3 |
<body> |
| 4 |
<h1>pnmtofiasco</h1> |
| 5 |
Updated: 09 April 2025 |
| 6 |
<br> |
| 7 |
<a href="#index">Table Of Contents</a> |
| 8 |
|
| 9 |
<h2>NAME</h2> |
| 10 |
|
| 11 |
pnmtofiasco - Convert PNM file to FIASCO compressed file |
| 12 |
|
| 13 |
<h2 id="synopsis">SYNOPSIS</h2> |
| 14 |
|
| 15 |
<b>pnmtofiasco</b> |
| 16 |
[<i>option</i>]... |
| 17 |
[<i>filename</i>]... |
| 18 |
|
| 19 |
<h2 id="description">DESCRIPTION</h2> |
| 20 |
|
| 21 |
<p>This program is part of <a href="index.html">Netpbm</a>. |
| 22 |
|
| 23 |
<b>pnmtofiasco</b> compresses the named pbm, pgm, or ppm image files, |
| 24 |
or Standard Input if no file is named, and produces a FIASCO file on |
| 25 |
Standard Output. |
| 26 |
|
| 27 |
<h2 id="options">OPTIONS</h2> |
| 28 |
|
| 29 |
<p>In addition to the options common to all programs based on libnetpbm |
| 30 |
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions"> |
| 31 |
Common Options</a>), <b>pnmtofiasco</b> recognizes the following |
| 32 |
command line options: |
| 33 |
|
| 34 |
<p>All option names may be abbreviated; for example, --optimize may be |
| 35 |
written --optim or --opt. For most options a one letter short option |
| 36 |
is provided. Mandatory or optional arguments to long options are |
| 37 |
mandatory or optional for short options, too. Both short and long |
| 38 |
options are case sensitive. |
| 39 |
|
| 40 |
<h3 id="basicopts">Basic Options</h3> |
| 41 |
|
| 42 |
<dl compact> |
| 43 |
<dt><b>--image-name=</b><i>name</i>, <b>-i</b> <i>name</i> |
| 44 |
|
| 45 |
<dd>Compress the named images, not Standard Input. If <i>name</i> is |
| 46 |
<b>-</b>, read Standard Input. <i>name</i> has to be either an image |
| 47 |
filename or a template of the form: |
| 48 |
|
| 49 |
<pre> |
| 50 |
prefix[start-end{+,-}step]suffix<br> |
| 51 |
</pre> |
| 52 |
|
| 53 |
<p>Templates are useful when compressing video streams: e.g., if you |
| 54 |
specify the template <b>img0[12-01-2].pgm</b>, then <b>pnmtofiasco</b> |
| 55 |
compresses the images img012.pgm, img010.pgm, ..., img002.pgm. |
| 56 |
|
| 57 |
<p>If <i>name</i> is a relative path, <b>pnmtofiasco </b> searches for |
| 58 |
the image files in the current directory and in the (colon-separated) |
| 59 |
list of directories given by the environment variable |
| 60 |
<b>FIASCO_IMAGES</b>. |
| 61 |
|
| 62 |
<dt><b>--output-name=</b><i>name</i>, <b>-o</b> <i>output-file</i> |
| 63 |
|
| 64 |
<dd>Write FIASCO output to the named file, not to Standard Output. |
| 65 |
|
| 66 |
<p>If <i>name</i> is a relative path and the environment variable |
| 67 |
<b>FIASCO_DATA</b> is a (colon-separated) list of directories, then |
| 68 |
<b>pnmtofiasco</b> writes the output file to the first (writable) |
| 69 |
directory of this list. Otherwise, <b>pnmtofiasco</b> write it to the |
| 70 |
current directory. |
| 71 |
|
| 72 |
<dt><b>--quality=</b><i>N</i>, <b>-q</b> <i>N</i> |
| 73 |
|
| 74 |
<dd>Set quality of compression to <i>N</i>. Quality is 1 (worst) to |
| 75 |
100 (best); default is 20. |
| 76 |
|
| 77 |
<dt><b>--version</b>, <b>-v</b> |
| 78 |
|
| 79 |
<dd>Print <b>pnmtofiasco</b> version number, then exit. |
| 80 |
|
| 81 |
<dt><b>--verbose </b><i>N</i>, <b>-V</b> <i>N</i> |
| 82 |
|
| 83 |
<dd>Set level of verbosity to <i>N</i>. Level is 0 (no output at |
| 84 |
all), 1 (show progress meter), or 2 (show detailed compression |
| 85 |
statistics); default is 1. |
| 86 |
|
| 87 |
<dt><b>--progress-meter </b><i>N</i>, <b>-B</b> <i>N</i> |
| 88 |
|
| 89 |
<dd>Set type of progress-meter to <i>N</i>. The following types are |
| 90 |
available; default is 1: |
| 91 |
|
| 92 |
<dl> |
| 93 |
<dt><b>0</b> |
| 94 |
<dd>no progress meter |
| 95 |
|
| 96 |
<dt><b>1</b> |
| 97 |
<dd>RPM style progress bar using 50 hash marks |
| 98 |
|
| 99 |
<dt><b>2</b> |
| 100 |
|
| 101 |
<dd>percentage meter |
| 102 |
|
| 103 |
</dl> |
| 104 |
|
| 105 |
<dt><b>--config=</b><i>name</i>, <b>-f</b> <i>name</i> |
| 106 |
|
| 107 |
<dd>Load parameter file <i>name </i> to initialize the options of |
| 108 |
<b>pnmtofiasco</b>. See file <b>system.fiascorc</b> for an example of |
| 109 |
the syntax. Options of <b>pnmtofiasco</b> are set by any of the |
| 110 |
following methods (in the specified order): |
| 111 |
|
| 112 |
<ol> |
| 113 |
<li>Global resource file <b>/etc/system.fiascorc</b> |
| 114 |
<li>$HOME/.fiascorc |
| 115 |
<li>command line |
| 116 |
<li>--config=<i>name</i> |
| 117 |
</ol> |
| 118 |
|
| 119 |
<dt><b>--info</b>, <b>-h</b> |
| 120 |
|
| 121 |
<dd>Print brief help, then exit. |
| 122 |
|
| 123 |
<dt><b>--help</b>, <b>-H</b> |
| 124 |
|
| 125 |
<dd>Print detailed help, then exit. |
| 126 |
|
| 127 |
</dl> |
| 128 |
|
| 129 |
<h3 id="advancedopts">Options for Advanced Users</h3> |
| 130 |
|
| 131 |
<dl> |
| 132 |
<dt><b>--basis-name=</b><i>name</i>, <b>-b</b> <i>name</i> |
| 133 |
|
| 134 |
<dd>Preload compression basis <i>name</i> into FIASCO. The basis |
| 135 |
<i>name</i> provides the initial compression dictionary. Either use |
| 136 |
one of the files "small.fco", "medium.fco", or |
| 137 |
"large.fco" that come with <b>pnmtofiasco </b> or create a |
| 138 |
new ASCII basis file. |
| 139 |
|
| 140 |
<dt><b>--optimize=</b><i>N</i>, <b>-z</b> <i>N</i> |
| 141 |
|
| 142 |
<dd>Set optimization level to <i>N</i>. Level is 0 (fastest) to 3 |
| 143 |
(slowest). |
| 144 |
|
| 145 |
Be warned: The encoding time dramatically increases when <i>N</i>=<b>2</b> |
| 146 |
or <i>N</i>=<b>3</b> while the compression performance improves only slightly. |
| 147 |
|
| 148 |
<p>The default is 0. |
| 149 |
|
| 150 |
<dt><b>--prediction</b>, <b>-P</b> |
| 151 |
|
| 152 |
<dd>Use additional predictive coding. If this optimization is enabled |
| 153 |
then the image is compressed in two steps. In the first step, a coarse |
| 154 |
approximation of the image is computed using large unichrome |
| 155 |
blocks. Finally, the delta image is computed and the prediction error |
| 156 |
is approximated using the standard FIASCO algorithm. |
| 157 |
|
| 158 |
<dt><b>--dictionary-size=</b><i>N</i>, <b>-D</b> <i>N</i> |
| 159 |
|
| 160 |
<dd>Set size of dictionary that is used when coding the luminance band |
| 161 |
to <i>N</i>; default is 10000, i.e., the dictionary is not restricted. |
| 162 |
|
| 163 |
<dt><b>--chroma-dictionary=</b><i>N</i>, <b>-C</b> <i>N</i> |
| 164 |
|
| 165 |
<dd>Set size of dictionary that is used when coding chroma bands to |
| 166 |
<i>N</i>; default is 40. |
| 167 |
|
| 168 |
<dt><b>--chroma-qfactor=</b><i>N</i>, <b>-Q</b> <i>N</i> |
| 169 |
|
| 170 |
<dd>Reduce the quality of chroma band compression <i>N</i>-times with |
| 171 |
respect to the user defined quality <i>q</i> of the luminance band |
| 172 |
compression (<b>--quality</b>=<i>q</i>); default is 2. |
| 173 |
|
| 174 |
<dt><b>--tiling-exponent=</b><i>N</i>, <b>-t</b> <i>N</i> |
| 175 |
|
| 176 |
<dd>Subdivide the image into 2^<i>N</i> tiles prior coding; default is |
| 177 |
4, i.e. the image is subdivided into 16 tiles. The processing order of |
| 178 |
the individual tiles is defined by the option |
| 179 |
|
| 180 |
<dt><b>--tiling-method=</b><i>name</i>, <b>-T</b> <i>name</i> |
| 181 |
|
| 182 |
<dd>Order the individual image tiles (the image is subdivided into; |
| 183 |
see option <b>--tiling-exponent=</b><i>N</i>) by method <i>name</i>; |
| 184 |
default is <b>desc-variance</b>. |
| 185 |
|
| 186 |
<dl> |
| 187 |
<dt><b>desc-variance</b> |
| 188 |
<dd>Tiles with small variances are processed first. |
| 189 |
|
| 190 |
<dt><b>asc-variance</b> |
| 191 |
<dd>Tiles with large variances are processed first. |
| 192 |
|
| 193 |
<dt><b>desc-spiral</b> |
| 194 |
<dd>Tiles are process in spiral order starting in the middle. |
| 195 |
|
| 196 |
<dt><b>asc-spiral</b> |
| 197 |
<dd>Tiles are process in spiral order starting at the border. |
| 198 |
|
| 199 |
</dl> |
| 200 |
|
| 201 |
<dt><b>--rpf-mantissa=</b><i>N</i> |
| 202 |
|
| 203 |
<dd>Use <i>N</i> mantissa bits for quantized coefficients. |
| 204 |
|
| 205 |
<dt><b>--dc-rpf-mantissa=</b><i>N</i> |
| 206 |
<dd>Use <i>N</i> mantissa bits for quantized DC coefficients. |
| 207 |
|
| 208 |
<dt><b>--rpf-range=</b><i>N</i> |
| 209 |
|
| 210 |
<dd>Coefficients outside the quantization interval |
| 211 |
[-<i>N</i>,+<i>N</i>] are set to zero. |
| 212 |
|
| 213 |
<dt><b>--dc-rpf-range=</b><i>N</i> |
| 214 |
|
| 215 |
<dd>DC coefficients outside the quantization interval |
| 216 |
[-<i>N</i>,+<i>N</i>] are set to zero. |
| 217 |
|
| 218 |
</dl> |
| 219 |
|
| 220 |
|
| 221 |
<h3 id="videoopts">Additional Options for Video Compression</h3> |
| 222 |
|
| 223 |
<dl> |
| 224 |
<dt><b>--smooth=</b><i>N</i>, <b>-s</b> <i>N</i> |
| 225 |
|
| 226 |
<dd>Smooth decompressed reference frames along the partitioning |
| 227 |
borders by the given amount <i>N</i>. <i>N</i> is 0 (no smoothing) to |
| 228 |
100; default is 70. This factor is stored in the FIASCO file. |
| 229 |
|
| 230 |
<dt><b>--min-level=</b><i>N</i>, <b>-m</b> <i>N</i> |
| 231 |
|
| 232 |
<dd>Start prediction (motion compensated prediction or additional |
| 233 |
prediction) on block level <i>N</i>; default is level 6. I.e., motion |
| 234 |
compensation is applied to all image blocks of at least 8x8 pixels |
| 235 |
(binary tree level <i>N</i>=6), 16x8 (<i>N</i>=7), 16x16 (<i>N</i>=8), |
| 236 |
etc. |
| 237 |
|
| 238 |
<dt><b>--max-level=</b><i>N</i>, <b>-M</b> <i>N</i> |
| 239 |
|
| 240 |
<dd>Stop prediction (motion compensated prediction or additional |
| 241 |
prediction) on block level <i>N</i>; default is level 10. I.e., |
| 242 |
motion compensation is applied to all image blocks of at most 16x16 |
| 243 |
pixels (<i>N</i>=8), 32x16 (<i>N</i>=9), 32x32 (<i>N</i>=10), etc. |
| 244 |
|
| 245 |
<dt><b>--half-pixel</b>, <b>-2</b> |
| 246 |
|
| 247 |
<dd>Use half pixel precise motion compensation. |
| 248 |
|
| 249 |
<dt><b>--fps=</b><i>N</i>, <b>-F</b> <i>N</i> |
| 250 |
|
| 251 |
<dd>Set number of frames per second to <i>N</i>. This value is stored |
| 252 |
in the FIASCO output file and is used in the decoder <a |
| 253 |
href="fiascotopnm.html">fiascotopnm</a> to control the framerate. |
| 254 |
|
| 255 |
<dt><b>--pattern=</b><i>type</i>, <b>-p</b> <i>type</i> |
| 256 |
|
| 257 |
<dd>Defines the type of inter frame compression which should be |
| 258 |
applied to individual frames of a video stream. <i>type</i> is a |
| 259 |
sequence of characters; default is "IPPPPPPPPP". Element |
| 260 |
<b>N</b> defines the type of predicting which should be used for frame |
| 261 |
<b>N</b>; the frame type pattern is periodically extended. Valid |
| 262 |
characters are: |
| 263 |
|
| 264 |
<dl> |
| 265 |
<dt><b>I</b> |
| 266 |
<dd>intra frame, i.e., no motion compensated prediction is used at |
| 267 |
all. |
| 268 |
|
| 269 |
<dt><b>P</b> |
| 270 |
<dd>predicted frame, i.e., a previously encoded frame is used for |
| 271 |
prediction (forward prediction). |
| 272 |
|
| 273 |
<dt><b>B</b> |
| 274 |
<dd>bidirectional predicted frame, i.e., not only a previously shown |
| 275 |
frame but also a frame of the future is used for prediction (forward, |
| 276 |
backward or interpolated prediction). |
| 277 |
|
| 278 |
</dl> |
| 279 |
|
| 280 |
<dt><b>--cross-B-search</b> |
| 281 |
|
| 282 |
<dd>Instead of using exhaustive search the "Cross-B-Search" |
| 283 |
algorithm is used to find the best interpolated prediction of |
| 284 |
B-frames. |
| 285 |
|
| 286 |
<dt><b>--B-as-past-ref</b> |
| 287 |
|
| 288 |
<dd>Also use previously encoded B-frames when prediction the current |
| 289 |
frame. If this option is not set, only I- and P-frames are used to |
| 290 |
predict the current frame. |
| 291 |
|
| 292 |
</dl> |
| 293 |
|
| 294 |
|
| 295 |
<h2 id="examples">EXAMPLES</h2> |
| 296 |
|
| 297 |
<p>Compress the still image "foo.ppm" to the FIASCO file |
| 298 |
"foo.wfa" using the default options: |
| 299 |
|
| 300 |
<pre> |
| 301 |
pnmtofiasco < foo.ppm >foo.wfa |
| 302 |
</pre> |
| 303 |
|
| 304 |
<p>Compress the video frames "foo0*.ppm" to the FIASCO file |
| 305 |
"video.wfa" using half pixel precise motion compensation at |
| 306 |
a frame rate of 15 frames per second. Intra frame 1 is used to |
| 307 |
predict P-frame 4, frames 1 and 4 are used to predict B-frames 2 and |
| 308 |
3, and so on. Frame 10 is again an intra-frame. |
| 309 |
|
| 310 |
<pre> |
| 311 |
pnmtofiasco -2 -p "IBBPBBPBB" -fps 15 -o video.wfa foo0*.ppm |
| 312 |
</pre> |
| 313 |
|
| 314 |
<h2 id="files">FILES</h2> |
| 315 |
|
| 316 |
<dl compact> |
| 317 |
<dt><b>/etc/system.fiascorc</b> |
| 318 |
|
| 319 |
<dd>The systemwide initialization file. |
| 320 |
|
| 321 |
<dt>$HOME<b>/.fiascorc</b> |
| 322 |
|
| 323 |
<dd>The personal initialization file. |
| 324 |
|
| 325 |
</dl> |
| 326 |
|
| 327 |
<h2 id="environment">ENVIRONMENT</h2> |
| 328 |
|
| 329 |
|
| 330 |
<dl compact> |
| 331 |
|
| 332 |
<dt><b>FIASCO_IMAGES</b> |
| 333 |
|
| 334 |
<dd>Search path for image files. Default is "./". |
| 335 |
|
| 336 |
<dt><b>FIASCO_DATA</b> |
| 337 |
|
| 338 |
<dd>Search and save path for FIASCO files. Default is "./". |
| 339 |
|
| 340 |
</dl> |
| 341 |
|
| 342 |
<h2 id="seealso">SEE ALSO</h2> |
| 343 |
|
| 344 |
<b><a href="fiascotopnm.html">fiascotopnm</a></b>, |
| 345 |
<b><a href="pnmtojpeg.html">pnmtojpeg</a></b>, |
| 346 |
<b><a href="pnmtojbig.html">pnmtojbig</a></b>, |
| 347 |
<b><a href="pamtogif.html">pamtogif</a></b>, |
| 348 |
<b><a href="pnm.html">pnm</a></b> |
| 349 |
|
| 350 |
<p>Ullrich Hafner, Juergen Albert, Stefan Frank, and Michael Unger. |
| 351 |
<b>Weighted Finite Automata for Video Compression</b>, IEEE Journal on |
| 352 |
Selected Areas In Communications, January 1998 |
| 353 |
|
| 354 |
<p>Ullrich Hafner. <b>Low Bit-Rate Image and Video Coding with |
| 355 |
Weighted Finite Automata</b>, Ph.D. thesis, Mensch & Buch Verlag, |
| 356 |
ISBN 3-89820-002-7, October 1999. |
| 357 |
|
| 358 |
<p>FIASCO: An Open-Source Fractal Image and Sequence Codec, Linux Journal, |
| 359 |
January 2001. |
| 360 |
|
| 361 |
<h2 id="author">AUTHOR</h2> |
| 362 |
|
| 363 |
Ullrich Hafner <<a href="mailto:[email protected]">[email protected]</a>> |
| 364 |
|
| 365 |
<hr> |
| 366 |
<h2 id="index">Table Of Contents</h2> |
| 367 |
<ul> |
| 368 |
<li><a href="#synopsis">SYNOPSIS</a> |
| 369 |
<li><a href="#description">DESCRIPTION</a> |
| 370 |
<li><a href="#options">OPTIONS</a> |
| 371 |
<ul> |
| 372 |
<li><a href="#basicopts">Basic Options</a> |
| 373 |
<li><a href="#advancedopts">Options for Advanced Users</a> |
| 374 |
<li><a href="#videoopts">Additional Options for Video Compression</a> |
| 375 |
</ul> |
| 376 |
<li><a href="#examples">EXAMPLES</a> |
| 377 |
<li><a href="#files">FILES</a> |
| 378 |
<li><a href="#environment">ENVIRONMENT</a> |
| 379 |
<li><a href="#seealso">SEE ALSO</a> |
| 380 |
<li><a href="#author">AUTHOR</a> |
| 381 |
</ul> |
| 382 |
</body> |
| 383 |
</html> |