/usr/share/doc/optipng/optipng.man.html is in optipng 0.7.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | <!-- Creator : groff version 1.22.3 -->
<!-- CreationDate: Sun Apr 3 11:39:00 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>OPTIPNG</title>
</head>
<body>
<h1 align="center">OPTIPNG</h1>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>OptiPNG</b>
− Optimize Portable Network Graphics files</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>optipng</b>
[<b>−?</b> | <b>−h</b> | <b>−help</b>]
<b><br>
optipng</b> [<i>options...</i>] <i>files...</i></p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The
<b>OptiPNG</b> program shall attempt to <i>optimize</i> PNG
files, i.e. reduce their size to a minimum, without losing
semantic information. In addition, this program shall
perform a suite of auxiliary functions like integrity
checks, metadata recovery and pixmap-to-PNG conversion.</p>
<p style="margin-left:11%; margin-top: 1em">The
optimization attempts are not guaranteed to succeed. Valid
PNG files that cannot be optimized by this program are
normally left intact; their size will not grow. The user may
request to override this default behavior.</p>
<h2>FILES
<a name="FILES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The input files
are raster image files encoded either in PNG format (the
native format), or in an external format. The currently
supported external formats are GIF, BMP, PNM and TIFF.</p>
<p style="margin-left:11%; margin-top: 1em"><b>OptiPNG</b>
processes each image file given in the command line as
follows:</p>
<p style="margin-left:11%; margin-top: 1em">− If the
image is in PNG format:</p>
<p style="margin-left:22%; margin-top: 1em">Attempts to
optimize the given file in-place. If optimization is
successful, or if the option <b>−force</b> is enabled,
replaces the original file with its optimized version. The
original file is backed up if the option <b>−keep</b>
is enabled.</p>
<p style="margin-left:11%; margin-top: 1em">− If the
image is in an external format:</p>
<p style="margin-left:22%; margin-top: 1em">Creates an
optimized PNG version of the given file. The output file
name is composed from the original file name and the
<tt>.png</tt> extension.</p>
<p style="margin-left:11%; margin-top: 1em">Existing files
are <i>not</i> overwritten, unless the option
<b>−clobber</b> is enabled.</p>
<h2>OPTIONS
<a name="OPTIONS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>General
options <br>
−?</b>, <b>−h</b>, <b>−help</b></p>
<p style="margin-left:22%;">Show a complete summary of
options.</p>
<p style="margin-left:11%;"><b>−backup</b>,
<b>−keep</b></p>
<p style="margin-left:22%;">Keep a backup of the modified
files.</p>
<p style="margin-left:11%;"><b>−clobber</b></p>
<p style="margin-left:22%;">Overwrite the existing output
and backup files. <br>
Under this option, if the option <b>−backup</b> is not
enabled, the old backups of the overwritten files are
deleted.</p>
<p style="margin-left:11%;"><b>−dir</b>
<i>directory</i></p>
<p style="margin-left:22%;">Write the output files to
<i>directory</i>.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">
<p><b>−fix</b></p></td>
<td width="5%"></td>
<td width="78%">
<p>Enable error recovery. This option has no effect on
valid input files.</p></td></tr>
</table>
<p style="margin-left:22%;">The program will spend a
reasonable amount of effort to recover as much data as
possible, without increasing the output file size, but the
success cannot be generally guaranteed. The program may even
increase the file size, e.g., by reconstructing missing
critical data. Under this option, integrity shall take
precedence over file size. <br>
When this option is not used, the invalid input files are
left unprocessed.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="9%">
<p style="margin-top: 1em"><b>−force</b></p></td>
<td width="2%"></td>
<td width="56%">
<p style="margin-top: 1em">Enforce writing of a new output
file.</p> </td>
<td width="22%">
</td></tr>
</table>
<p style="margin-left:22%;">This option overrides the
program’s decision not to write such file, e.g. when
the PNG input is digitally signed (using dSIG), or when the
PNG output becomes larger than the PNG input.</p>
<p style="margin-left:11%;"><b>−log</b>
<i>file</i></p>
<p style="margin-left:22%;">Log messages to <i>file</i>.
For safety reasons, <i>file</i> must have the extension
<tt>.log</tt>. <br>
This option is deprecated and will be removed eventually.
Use shell redirection.</p>
<p style="margin-left:11%;"><b>−out</b>
<i>file</i></p>
<p style="margin-left:22%;">Write output file to
<i>file</i>. The command line must contain exactly one input
file.</p>
<p style="margin-left:11%;"><b>−preserve</b></p>
<p style="margin-left:22%;">Preserve file attributes (time
stamps, file access rights, etc.) where applicable.</p>
<p style="margin-left:11%;"><b>−quiet</b>,
<b>−silent</b></p>
<p style="margin-left:22%;">Run in quiet mode. <br>
The messages are still written to the log file if the option
<b>−log</b> is enabled.</p>
<p style="margin-left:11%;"><b>−simulate</b></p>
<p style="margin-left:22%;">Run in simulation mode: perform
the trials, but do not create output files.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>−v</b></p></td>
<td width="8%"></td>
<td width="63%">
<p>Enable the options <b>−verbose</b> and
<b>−version</b>.</p> </td>
<td width="15%">
</td></tr>
</table>
<p style="margin-left:11%;"><b>−verbose</b></p>
<p style="margin-left:22%;">Run in verbose mode.</p>
<p style="margin-left:11%;"><b>−version</b></p>
<p style="margin-left:22%;">Show copyright, version and
build info.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>−−</b></p></td>
<td width="8%"></td>
<td width="41%">
<p>Stop option switch parsing.</p></td>
<td width="37%">
</td></tr>
</table>
<p style="margin-left:11%; margin-top: 1em"><b>PNG encoding
and optimization options <br>
−o</b> <i>level</i></p>
<p style="margin-left:22%;">Select the optimization level.
<br>
The optimization level 0 enables a set of optimization
operations that require minimal effort. There will be no
changes to image attributes like bit depth or color type,
and no recompression of existing IDAT datastreams. <br>
The optimization level 1 enables a single IDAT compression
trial. The trial chosen is what <b>OptiPNG</b> <i>thinks</i>
it’s probably the most effective. <br>
The optimization levels 2 and higher enable multiple IDAT
compression trials; the higher the level, the more trials.
<br>
The behavior and the default value of this option may change
across different program versions. Use the option
<b>−h</b> to see the details pertaining to your
specific version.</p>
<p style="margin-left:11%;"><b>−f</b>
<i>filters</i></p>
<p style="margin-left:22%;">Select the PNG delta filters.
<br>
The <i>filters</i> argument is specified as a rangeset (e.g.
<b>−f0−5</b>), and the default <i>filters</i>
value depends on the optimization level set by the option
<b>−o</b>. <br>
The filter values 0, 1, 2, 3 and 4 indicate static
filtering, and correspond to the standard PNG filter codes
(<i>None</i>, <i>Left</i>, <i>Up</i>, <i>Average</i> and
<i>Paeth</i>, respectively). The filter value 5 indicates
adaptive filtering, whose effect is defined by the
<b>libpng</b>(3) library used by <b>OptiPNG</b>.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p><b>−full</b></p></td>
<td width="4%"></td>
<td width="78%">
<p>Produce a full report on IDAT. This option might slow
down the trials.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>−i</b> <i>type</i></p>
<p style="margin-left:22%;">Select the interlace type
(0−1). <br>
If the interlace type 0 is selected, the output image shall
be non-interlaced (i.e. progressive-scanned). If the
interlace type 1 is selected, the output image shall be
interlaced using the <i>Adam7</i> method. <br>
By default, the output shall have the same interlace type as
the input.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>−nb</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Do not apply bit depth reduction.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>−nc</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Do not apply color type reduction.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>−np</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Do not apply palette reduction.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>−nx</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Do not apply any lossless image reduction: enable the
options <b>−nb</b>, <b>−nc</b> and
<b>−np</b>.</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="4%">
<p><b>−nz</b></p></td>
<td width="7%"></td>
<td width="78%">
<p>Do not recode IDAT datastreams.</p></td></tr>
</table>
<p style="margin-left:22%;">The IDAT optimization
operations that do not require recoding (e.g. IDAT chunk
concatenation) are still performed. <br>
This option has effect on PNG input files only.</p>
<p style="margin-left:11%;"><b>−zc</b>
<i>levels</i></p>
<p style="margin-left:22%;">Select the zlib compression
levels used in IDAT compression. <br>
The <i>levels</i> argument is specified as a rangeset (e.g.
<b>−zc6−9</b>), and the default <i>levels</i>
value depends on the optimization level set by the option
<b>−o</b>. <br>
The effect of this option is defined by the <b>zlib</b>(3)
library used by <b>OptiPNG</b>.</p>
<p style="margin-left:11%;"><b>−zm</b>
<i>levels</i></p>
<p style="margin-left:22%;">Select the zlib memory levels
used in IDAT compression. <br>
The <i>levels</i> argument is specified as a rangeset (e.g.
<b>−zm8−9</b>), and the default <i>levels</i>
value depends on the optimization level set by the option
<b>−o</b>. <br>
The effect of this option is defined by the <b>zlib</b>(3)
library used by <b>OptiPNG</b>.</p>
<p style="margin-left:11%;"><b>−zs</b>
<i>strategies</i></p>
<p style="margin-left:22%;">Select the zlib compression
strategies used in IDAT compression. <br>
The <i>strategies</i> argument is specified as a rangeset
(e.g. <b>−zs0−3</b>), and the default
<i>strategies</i> value depends on the optimization level
set by the option <b>−o</b>. <br>
The effect of this option is defined by the <b>zlib</b>(3)
library used by <b>OptiPNG</b>.</p>
<p style="margin-left:11%;"><b>−zw</b>
<i>size</i></p>
<p style="margin-left:22%;">Select the zlib window size
(32k,16k,8k,4k,2k,1k,512,256) used in IDAT compression. <br>
The <i>size</i> argument can be specified either in bytes
(e.g. 16384) or kilobytes (e.g. 16k). The default
<i>size</i> value is set to the lowest window size that
yields an IDAT output as big as if yielded by the value
32768. <br>
The effect of this option is defined by the <b>zlib</b>(3)
library used by <b>OptiPNG</b>.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Editing
options</b></p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p><b>−snip</b></p></td>
<td width="4%"></td>
<td width="78%">
<p>Cut one image out of multi-image, animation or video
files.</p> </td></tr>
</table>
<p style="margin-left:22%;">Depending on the input format,
this may be either the first or the most relevant (e.g. the
largest) image.</p>
<p style="margin-left:11%;"><b>−strip</b>
<i>objects</i></p>
<p style="margin-left:22%;">Strip metadata objects from a
PNG file. <br>
PNG metadata is the information stored in any ancillary
chunk except tRNS. (tRNS represents the alpha channel,
which, even if ignored in rendering, is still a proper image
channel in the RGBA color space.) <br>
The only option currently supported is <b>−strip
all</b>.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Notes</b>
<br>
Options may come in any order (except for
<b>−−</b>), before, after, or alternating with
file names. Option names are case-insensitive and may be
abbreviated to their shortest unique prefix.</p>
<p style="margin-left:11%; margin-top: 1em">Some options
may have arguments that follow the option name, separated by
whitespace or the equal sign (’<b>=</b>’). If
the option argument is a number or a rangeset, the separator
may be omitted. For example:</p>
<p style="margin-left:22%; margin-top: 1em"><b>−out</b>
<tt>newfile.png </tt><=>
<b>−out=</b><tt>newfile.png</tt> <b><br>
−o3 </b><=> <b>−o 3
</b><=> <b>−o=3 <br>
−f0,3−5 </b><=> <b>−f
0,3−5 </b><=>
<b>−f=0,3−5</b></p>
<p style="margin-left:11%; margin-top: 1em">Rangeset
arguments are cumulative; e.g.</p>
<p style="margin-left:22%; margin-top: 1em"><b>−f0
−f3−5 </b><=>
<b>−f0,3−5 <br>
−zs0 −zs1 −zs2−3 </b><=>
<b>−zs0,1,2,3 </b><=>
<b>−zs0−3</b></p>
<h2>EXTENDED DESCRIPTION
<a name="EXTENDED DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The PNG
optimization algorithm consists of the following steps:</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p>1.</p></td>
<td width="3%"></td>
<td width="83%">
<p>Reduce the bit depth, the color type and the color
palette of the image. This step may reduce the size of the
uncompressed image, which, indirectly, may reduce the size
of the compressed image (i.e. the size of the output PNG
file).</p> </td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p>2.</p></td>
<td width="3%"></td>
<td width="83%">
<p>Run a suite of compression methods and strategies and
select the compression parameters that yield the smallest
output file.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p>3.</p></td>
<td width="3%"></td>
<td width="83%">
<p>Store all IDAT contents into a single chunk, eliminating
the overhead incurred by repeated IDAT headers and CRCs.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p>4.</p></td>
<td width="3%"></td>
<td width="83%">
<p>Set the zlib window size inside IDAT to a mininum that
does not affect the compression ratio, reducing the memory
requirements of PNG decoders.</p></td></tr>
</table>
<p style="margin-left:11%; margin-top: 1em">Not all of the
above steps need to be executed. The behavior depends on the
actual input files and user options.</p>
<p style="margin-left:11%; margin-top: 1em">Step 1 may be
customized via the no-reduce options <b>−nb</b>,
<b>−nc</b>, <b>−np</b> and <b>−nx</b>.
Step 2 may be customized via the <b>−o</b> option, and
may be fine-tuned via the options <b>−zc</b>,
<b>−zm</b>, <b>−zs</b> and <b>−zw</b>.
Step 3 is always executed. Step 4 is executed only if a new
IDAT is being created, and may be fine-tuned via the option
<b>−zw</b>.</p>
<p style="margin-left:11%; margin-top: 1em">Extremely
exhaustive searches are not generally expected to yield
significant improvements in compression ratio, and are
recommended to advanced users only.</p>
<h2>EXAMPLES
<a name="EXAMPLES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><tt>optipng
file.png </tt># default speed
<tt><br>
optipng -o5 file.png </tt># slow <tt><br>
optipng -o7 file.png </tt># very slow</p>
<h2>BUGS
<a name="BUGS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Lossless image
reductions are not completely implemented. (This does
<i>not</i> affect the integrity of the output files.) Here
are the missing pieces:</p>
<p style="margin-left:22%; margin-top: 1em">− The
color palette reductions are implemented only partially.
<br>
− The bit depth reductions below 8, for grayscale
images, are not implemented yet.</p>
<p style="margin-left:11%; margin-top: 1em">Encoding of
images whose total IDAT size exceeds 2GB is not
supported.</p>
<p style="margin-left:11%; margin-top: 1em">TIFF support is
limited to uncompressed, PNG-compatible (grayscale, RGB and
RGBA) images.</p>
<p style="margin-left:11%; margin-top: 1em">Metadata is not
imported from the external image formats.</p>
<p style="margin-left:11%; margin-top: 1em">There is no
support for pipes, streams, extended file attributes or
access control lists.</p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>png</b>(5),
<b>libpng</b>(3), <b>zlib</b>(3), <b>pngcrush</b>(1),
<b>pngrewrite</b>(1).</p>
<h2>STANDARDS
<a name="STANDARDS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">The files
produced by <b>OptiPNG</b> are compliant with
<b>PNG−2003</b>: <br>
Glenn Randers-Pehrson et al. <i>Portable Network Graphics
(PNG) Specification, Second Edition</i>. <br>
W3C Recommendation 10 November 2003; ISO/IEC IS 15948:2003
(E). <tt><br>
http://www.w3.org/TR/PNG/</tt></p>
<h2>AUTHOR
<a name="AUTHOR"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><tt><b>OptiPNG</b></tt>
is written and maintained by Cosmin Truta.</p>
<p style="margin-left:11%; margin-top: 1em">This manual
page was originally written by Nelson A. de Oliveira for the
Debian Project. It was later updated by Cosmin Truta, and is
now part of the <b>OptiPNG</b> distribution.</p>
<hr>
</body>
</html>
|