{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/codecs/images/png",
  "collection": "docs",
  "title": "PNG",
  "description": "PNG is the standard lossless format for screenshots, graphics and anything with transparency; this page covers when to use it and how to shrink files with oxipng, ECT and pngquant.",
  "canonicalUrl": "https://encode.wiki/codecs/images/png/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/codecs/images/png.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/codecs/images/png.md",
  "status": "current",
  "tags": [
    "migrated"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "PNG specification, third edition (W3C Recommendation, 24 June 2025)",
      "url": "https://www.w3.org/TR/png-3/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "oxipng 10.2.1 README and manual",
      "url": "https://github.com/oxipng/oxipng/tree/v10.2.1",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "oxipng 10.2.1 pinned parser and presets",
      "url": "https://github.com/oxipng/oxipng/tree/36f3ef8aac65ecf1761739ea2f2e530281f1312b",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "pngquant 3.0.3 README",
      "url": "https://github.com/kornelski/pngquant/blob/53a332a58f44357b6b41842a54d74aa1e245913d/README.md",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "pngquant 3.0.3 pinned Rust frontend",
      "url": "https://github.com/kornelski/pngquant/tree/53a332a58f44357b6b41842a54d74aa1e245913d",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "Efficient Compression Tool",
      "url": "https://github.com/fhanau/Efficient-Compression-Tool/blob/v0.9.5/src/main.cpp",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "OptiPNG 7.9.1 versioned manual",
      "url": "https://optipng.sourceforge.net/optipng-7.9.1.man1.html",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "Google ZopfliPNG pinned source snapshot",
      "url": "https://github.com/google/zopfli/tree/df1517dd8518113a245e4d203a04b8a0e02ab493",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/images/PNG.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/images/PNG.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "When to use it",
      "anchor": "when-to-use-it"
    },
    {
      "depth": 2,
      "text": "Shrink PNGs without changing pixels",
      "anchor": "shrink-pngs-without-changing-pixels"
    },
    {
      "depth": 3,
      "text": "oxipng",
      "anchor": "oxipng"
    },
    {
      "depth": 3,
      "text": "ECT",
      "anchor": "ect"
    },
    {
      "depth": 2,
      "text": "Shrink PNGs by reducing colours (lossy)",
      "anchor": "shrink-pngs-by-reducing-colours-lossy"
    },
    {
      "depth": 2,
      "text": "Pitfalls",
      "anchor": "pitfalls"
    },
    {
      "depth": 2,
      "text": "Full option reference",
      "anchor": "full-option-reference"
    },
    {
      "depth": 2,
      "text": "oxipng parameter reference",
      "anchor": "oxipng-parameter-reference"
    },
    {
      "depth": 2,
      "text": "OptiPNG parameter reference",
      "anchor": "optipng-parameter-reference"
    },
    {
      "depth": 2,
      "text": "pngquant parameter reference",
      "anchor": "pngquant-parameter-reference"
    },
    {
      "depth": 2,
      "text": "ZopfliPNG parameter reference",
      "anchor": "zopflipng-parameter-reference"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/codecs/images/png/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/_preamble.md",
      "checksum": "254c1e8aa9a7a74364db9cd78af4fc18592fcba02adb8c18b6449cf90aef6338",
      "bytes": 1086
    },
    {
      "id": "when-to-use-it",
      "title": "When to use it",
      "depth": 2,
      "anchor": "when-to-use-it",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#when-to-use-it",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/when-to-use-it.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/when-to-use-it.md",
      "checksum": "5a6b300caa060e2149da57c2a626ba3da45b66ae09152dd5e6236c9c4423c8e3",
      "bytes": 622
    },
    {
      "id": "shrink-pngs-without-changing-pixels",
      "title": "Shrink PNGs without changing pixels",
      "depth": 2,
      "anchor": "shrink-pngs-without-changing-pixels",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#shrink-pngs-without-changing-pixels",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/shrink-pngs-without-changing-pixels.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/shrink-pngs-without-changing-pixels.md",
      "checksum": "7957d833ffbf01403396ff846f598ee09248ec8bfc8bde185d01d978bee99972",
      "bytes": 1667
    },
    {
      "id": "oxipng",
      "title": "oxipng",
      "depth": 3,
      "anchor": "oxipng",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#oxipng",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/oxipng.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/oxipng.md",
      "checksum": "6d20878c218875cf45b851c729ac8b79171a02cd3b5ebcfc5833850ed947e2db",
      "bytes": 1084
    },
    {
      "id": "ect",
      "title": "ECT",
      "depth": 3,
      "anchor": "ect",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#ect",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/ect.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/ect.md",
      "checksum": "01b1545682ca45f70a775904190448618ebcfef5179c56f202c20b2b9f3a79db",
      "bytes": 542
    },
    {
      "id": "shrink-pngs-by-reducing-colours-lossy",
      "title": "Shrink PNGs by reducing colours (lossy)",
      "depth": 2,
      "anchor": "shrink-pngs-by-reducing-colours-lossy",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#shrink-pngs-by-reducing-colours-lossy",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/shrink-pngs-by-reducing-colours-lossy.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/shrink-pngs-by-reducing-colours-lossy.md",
      "checksum": "29b6735545897c346c8c1fdd6272d8d675e152164af73e1ea58be9f539ff7228",
      "bytes": 880
    },
    {
      "id": "pitfalls",
      "title": "Pitfalls",
      "depth": 2,
      "anchor": "pitfalls",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#pitfalls",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/pitfalls.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/pitfalls.md",
      "checksum": "e9c7673cd33e46c71b358729f58a51658a1aaedf87fbc5651e9bafcb15760799",
      "bytes": 1107
    },
    {
      "id": "full-option-reference",
      "title": "Full option reference",
      "depth": 2,
      "anchor": "full-option-reference",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#full-option-reference",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/full-option-reference.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/full-option-reference.md",
      "checksum": "472587080a5532c842eb4601d0cac27f3ad4d73624555b267bd33815156e5dd6",
      "bytes": 200
    },
    {
      "id": "oxipng-parameter-reference",
      "title": "oxipng parameter reference",
      "depth": 2,
      "anchor": "oxipng-parameter-reference",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#oxipng-parameter-reference",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/oxipng-parameter-reference.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/oxipng-parameter-reference.md",
      "checksum": "7cd6df9b8db859299d5538eb37f329104bc2a093fb4e67cca25e48d4ccfde987",
      "bytes": 9210
    },
    {
      "id": "optipng-parameter-reference",
      "title": "OptiPNG parameter reference",
      "depth": 2,
      "anchor": "optipng-parameter-reference",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#optipng-parameter-reference",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/optipng-parameter-reference.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/optipng-parameter-reference.md",
      "checksum": "c6d77fbdd4fbf2bc6b557e931878a4615c0c3c4997d64d38e7714a01d44cb093",
      "bytes": 8723
    },
    {
      "id": "pngquant-parameter-reference",
      "title": "pngquant parameter reference",
      "depth": 2,
      "anchor": "pngquant-parameter-reference",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#pngquant-parameter-reference",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/pngquant-parameter-reference.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/pngquant-parameter-reference.md",
      "checksum": "789f04ceb1ccc552988f35a65ac94737b3e316a701b98bd80a3657471456fc8f",
      "bytes": 5002
    },
    {
      "id": "zopflipng-parameter-reference",
      "title": "ZopfliPNG parameter reference",
      "depth": 2,
      "anchor": "zopflipng-parameter-reference",
      "canonicalUrl": "https://encode.wiki/codecs/images/png/#zopflipng-parameter-reference",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/zopflipng-parameter-reference.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/images/png/zopflipng-parameter-reference.md",
      "checksum": "c49b37a816126b85f61e50e40f85cd8a30df1407637d19cfce6ed5eff62ba16d",
      "bytes": 4801
    }
  ],
  "outboundReferences": [
    "/codecs/images/avif/",
    "/codecs/images/gif/",
    "/codecs/images/jpeg/",
    "/codecs/images/jxl/",
    "/codecs/images/webp/",
    "/reference/encoder-parameters/",
    "https://github.com/fhanau/Efficient-Compression-Tool",
    "https://github.com/google/zopfli",
    "https://github.com/oxipng/oxipng",
    "https://optipng.sourceforge.net/",
    "https://optipng.sourceforge.net/optipng-7.9.1.man1.html",
    "https://pngquant.org/"
  ],
  "checksum": "3a18275fa33a9592d585929b639f045fcf7a668c379f713240e355d5cdfe4ee5",
  "contentFormat": "markdown",
  "markdown": "PNG (1996) is the lossless format for screenshots, UI, diagrams, pixel art and anything that needs real transparency. It was created as a patent-free replacement for [GIF](/codecs/images/gif/), and the third edition of the spec (a W3C Recommendation since June 2025) adds animation (APNG), HDR colour signalling (`cICP`, `mDCV`, `cLLI`) and Exif.\n\n| Property     | Value                                                          |\n| ------------ | -------------------------------------------------------------- |\n| Compression  | Lossless (per-row filters plus DEFLATE)                        |\n| Bit depth    | 1, 2, 4, 8 or 16 bits per sample (palette up to 8 bits)        |\n| Colour types | Grayscale, RGB, indexed palette, with or without alpha         |\n| Alpha        | Full alpha channel, or per-entry alpha in palette images       |\n| Animation    | APNG, supported by all current browsers                        |\n| Progressive  | Adam7 interlacing (usually makes files larger)                 |\n| Royalty-free | Yes                                                            |\n\n## When to use it\n\n- **Use PNG** for screenshots, graphics with flat colour or sharp edges, masters you will edit again, and anything that must come out pixel-exact.\n- **Not for photos.** A photo as PNG is several times larger than a good JPEG, and usually larger than lossless [WebP](/codecs/images/webp/) or lossless [JPEG XL](/codecs/images/jxl/) too. Use [JPEG](/codecs/images/jpeg/), [AVIF](/codecs/images/avif/) or WebP for delivery.\n- **For smaller PNGs**, you have two routes: lossless recompression (oxipng, ECT) which never changes pixels, or palette quantisation (pngquant) which does and often saves 60–80%.\n\n## Shrink PNGs without changing pixels\n\n### oxipng\n\n[oxipng](https://github.com/oxipng/oxipng) is the usual choice: multithreaded, fast, and able to do limited optimisation of APNG. It rewrites files **in place** unless you give `--out` or `--dir`.\n\n```sh\noxipng -o 4 --strip safe image.png --out image.opt.png\noxipng -o max --strip safe *.png\n```\n\n| Option | What it does |\n| --- | --- |\n| `-o 0`…`-o 6`, `-o max` | Effort. Default is 2, which is fast and already good; higher levels have diminishing returns. `max` is level 6. |\n| `--strip safe` (`-s`) | Removes non-critical chunks but keeps `cICP`, `iCCP`, `sRGB`, `pHYs` and the APNG chunks. Use `--strip all` only if you are sure no colour or animation data matters. |\n| `--alpha` (`-a`) | Rewrites the colour of fully transparent pixels to compress better. Looks identical, but the hidden RGB values change. |\n| `-z` | Uses Zopfli instead of libdeflate. Slower, small extra gain. |\n| `--scale16` | Converts 16-bit to 8-bit. **Lossy**; oxipng otherwise keeps 16-bit data intact. |\n\nWithout `--strip` oxipng keeps every chunk that is still valid, including metadata.\n\n### ECT\n\n[Efficient Compression Tool](https://github.com/fhanau/Efficient-Compression-Tool) (`ect`) optimises PNG and JPEG (and gzip/zip) in place. Level `-9` is very slow; `-3` is the default.\n\n```sh\nect -9 -strip image.png\n```\n\n`ect` also recompresses JPEGs losslessly (`-progressive` makes them progressive). [ZopfliPNG](https://github.com/google/zopfli) and [OptiPNG](https://optipng.sourceforge.net/) do the same job; OptiPNG is the older tool, ZopfliPNG strips all ancillary chunks (including colour profiles) unless told to keep them.\n\n## Shrink PNGs by reducing colours (lossy)\n\n[pngquant](https://pngquant.org/) converts RGB/RGBA to an 8-bit palette with per-colour alpha, using dithering to hide the loss. It suits icons, illustrations and screenshots; smooth gradients and photos can band or posterise.\n\n```sh\npngquant --quality 65-90 --skip-if-larger --strip --output small.png input.png\n```\n\n- `--quality min-max` picks the fewest colours that reach `max`; if it cannot reach `min` it writes nothing and exits with status 99 (98 for `--skip-if-larger`).\n- `--speed` runs 1 (slowest, best) to 11. The default is 4 and the author recommends leaving it unless you need real-time speed.\n- `--nofs` turns off dithering (cleaner flat areas, more banding in gradients). `--floyd=0.5` reduces it.\n- `--ext .png --force` overwrites input files in place. There is no backup.\n\nRun oxipng on the result for a little more.\n\n## Pitfalls\n\n- **Metadata and colour**: PNG colour can come from `sRGB`, `iCCP`, `cICP`, or legacy `gAMA`/`cHRM`. oxipng's `--strip safe` drops `gAMA` and `cHRM`, and `--strip all` drops everything non-critical, so check images that depended on them. Missing profiles change how colour-managed viewers show the image.\n- **Interlacing**: Adam7 costs compression and is rarely worth it. oxipng removes it by default; use `-i keep` or `-i on` if you need it.\n- **Hidden RGB in transparent pixels**: `--alpha` and ZopfliPNG's `--lossy_transparent` change it. Harmless for display, wrong if the same file feeds a later edit or a texture pipeline.\n- **16-bit images**: many tools silently convert to 8-bit. Keep an eye on `--scale16`, ImageMagick's `-depth 8` and any \"web export\" preset.\n- **APNG**: only some tools keep every frame. `oxipng --strip all` and `optipng -snip` flatten animations. For animation that is not a looping sticker, an actual video or animated WebP/AVIF is far smaller.\n- **Large flat-colour screenshots** may compress better as lossless WebP or JPEG XL if the destination supports them.\n\n## Full option reference\n\nEvery option and default for oxipng 10.2.1, OptiPNG 7.9.1, pngquant 3.0.3 and ZopfliPNG. [Reading option tables](/reference/encoder-parameters/) explains the Default column.\n\n## oxipng parameter reference\n\nUse `--` before an input filename that begins with a hyphen. The hidden `-Z` is still accepted as an alias of `--zopfli`.\n\n<details>\n<summary>Complete oxipng 10.2.1 options and defaults</summary>\n\n| Parameter and aliases  | Type / accepted values      | Default                                     | Meaning and limits                                                                               |\n| ---------------------- | --------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------ |\n| `--opt`, `-o`          | enum 0–6/max                | 2                                           | Preset from 0 (fastest) to 6 or max (smallest); explicit coding options override it.             |\n| `--recursive`, `-r`    | switch                      | off                                         | Optimizes every .png and .apng file found in input directories.                                  |\n| `--dir`                | directory                   | not specified                               | Writes outputs into this directory, creating it; recursion flattens the folder layout.           |\n| `--out`                | path                        | not specified (input replaced if optimized) | Writes the result to this file instead of replacing the input.                                   |\n| `--stdout`             | switch                      | off                                         | Writes the PNG to stdout; cannot combine with --dir, --out or --json.                            |\n| `--preserve`, `-p`     | switch                      | off                                         | Keeps the original permissions and timestamps where possible.                                    |\n| `--dry-run`, `-d`      | switch                      | off                                         | Reports the savings without writing any file.                                                    |\n| `-s`                   | switch                      | off                                         | Same as --strip safe: removes non-essential chunks and keeps those that affect display.          |\n| `--strip`              | mode/list                   | keep valid chunks, except caBX/iDOT         | safe, all or a comma-separated chunk list; all also turns APNG into a plain PNG.                 |\n| `--keep`               | comma-separated chunk names | not specified                               | Strips everything except the listed chunks; display keeps the appearance-affecting set.          |\n| `--alpha`, `-a`        | switch                      | off                                         | Rewrites colour values of fully transparent pixels to compress better; visually lossless.        |\n| `--interlace`, `-i`    | enum                        | off; keep with --nx                         | off, on (Adam7) or keep; interlacing adds 25–50% to the size.                                    |\n| `--scale16`            | switch                      | off                                         | Reduces 16-bit channels to 8-bit by scaling; lossy.                                              |\n| `--verbose`, `-v`      | repeatable switch           | 0 occurrences                               | Shows per-file detail; repeat for more. Cannot combine with --quiet.                             |\n| `--quiet`, `-q`        | switch                      | off                                         | Suppresses all output.                                                                           |\n| `--json`, `-j`         | switch                      | off                                         | Prints results as JSON; cannot combine with --stdout.                                            |\n| `--filters`, `-f`      | integer list/range 0–9      | 0,1,6,7 at level 2                          | Row filters to try: 0–4 fixed, 5 MinSum, 6 Entropy, 7 Bigrams, 8 BigEnt, 9 Brute.                |\n| `--fast`               | switch                      | on at levels 0–4; off at 5–6                | Scores filters with a quick pass, then runs one full trial on the best.                          |\n| `--zc`                 | integer 0–12                | 11 at level 2                               | libdeflate level 0–12 for main trials; cannot combine with --zopfli.                             |\n| `--nb`                 | switch                      | off                                         | Keeps the original bit depth.                                                                    |\n| `--nc`                 | switch                      | off                                         | Keeps the original colour type.                                                                  |\n| `--np`                 | switch                      | off                                         | Does not convert to indexed colour or change an existing palette.                                |\n| `--ng`                 | switch                      | off                                         | Does not convert to or from greyscale.                                                           |\n| `--nx`                 | switch                      | off                                         | Disables every reduction and makes the default interlace mode keep.                              |\n| `--nz`                 | switch                      | off                                         | Skips IDAT recompression unless a transformation needs it; with --nx, disables all optimization. |\n| `--fix`                | switch                      | off                                         | Skips chunk checksum validation so damaged files can be processed; output checksums are valid.   |\n| `--force`              | switch                      | off                                         | Writes the output even when it is larger than the input.                                         |\n| `--zopfli`, `-z`, `-Z` | switch                      | off                                         | Uses Zopfli instead of libdeflate for main trials; much slower, a little smaller.                |\n| `--zi`                 | positive u64                | 15                                          | Zopfli iteration count; fewer is faster. Requires --zopfli.                                      |\n| `--ziwi`               | positive u64                | not specified                               | Stops Zopfli after this many iterations without improvement; pair with a high --zi.              |\n| `--brute-level`        | integer 1–12                | 1; 5 at level 6                             | libdeflate level for the Brute filter; 1–5 is sensible.                                          |\n| `--brute-lines`        | nonnegative integer         | 3; 4 at level 4; 8 at levels 5–6            | Rows compressed together by the Brute filter; 2–16 is sensible.                                  |\n| `--timeout`            | u64 seconds                 | no limit                                    | Time budget in seconds, checked between trials; a running trial can overrun it.                  |\n| `--max-raw-size`       | size with unit suffix       | no limit                                    | Skips images whose decompressed data exceeds this size; accepts suffixes like k or MB.           |\n| `--threads`, `-t`      | nonnegative integer         | logical CPU count                           | Maximum worker threads; 0 lets Rayon choose.                                                     |\n| `--sequential`         | switch                      | off (parallel file processing)              | Processes files one at a time, in order.                                                         |\n| `--help`, `-h`         | action                      | not requested                               | Shows help.                                                                                      |\n| `--version`, `-V`      | action                      | not requested                               | Prints the version.                                                                              |\n| `--`                   | action                      | not requested                               | Ends option parsing so later arguments are input paths.                                          |\n\n</details>\n\nPresets: `-o 0` uses filters `0,5` with libdeflate level 5; `-o 1` uses `0,7` and level 10; `-o 2` (default) uses `0,1,6,7` and level 11 with fast evaluation; `-o 3` adds filters `8,9`; `-o 4` uses level 12; `-o 5` and `-o 6` disable fast evaluation, `-o 6` uses every filter. Explicit `--filters`, `--zc`, `--brute-*` and `--fast` options override the preset regardless of order.\n\n`--strip safe` / `--keep display` keep `cICP`, `iCCP`, `sRGB`, `pHYs`, `acTL`, `fcTL` and `fdAT`, and drop other ancillary chunks such as `gAMA`, `cHRM`, `sBIT`, `mDCV` and `cLLI`. Without `--strip`, oxipng keeps every chunk that is still valid, but drops `caBX` and Apple `iDOT`.\n\n## OptiPNG parameter reference\n\nOptiPNG takes the same kind of optimisation switches but uses single-hyphen options, and documented prefixes are accepted as abbreviations. Prefer the full lowercase spelling. Attached forms such as `-o2`, `-f0,5` and `-zc9` are the same options.\n\n<details>\n<summary>Complete OptiPNG 7.9.1 options, aliases, and defaults</summary>\n\n| Parameter and aliases                                                           | Type / accepted values | Default                                        | Meaning and limits                                                               |\n| ------------------------------------------------------------------------------- | ---------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------- |\n| `-o`                                                                            | nonnegative integer    | 2                                              | Preset 0–7, higher is slower and smaller; larger values act as 7.                |\n| `-out`, `-ou`                                                                   | path                   | not specified (input can be replaced)          | Output file for a single input; cannot combine with -dir.                        |\n| `-dir`, `-d`, `-di`                                                             | directory              | not specified                                  | Output directory; cannot combine with -out.                                      |\n| `-backup`, `-b`, `-ba`, `-bac`, `-back`, `-backu`, `-keep`, `-k`, `-ke`, `-kee` | switch                 | off                                            | Keeps a .bak copy when overwriting the input.                                    |\n| `-clobber`, `-c`, `-cl`, `-clo`, `-clob`, `-clobb`, `-clobbe`                   | switch                 | off                                            | Allows replacing an existing output file.                                        |\n| `-fix`, `-fi`                                                                   | switch                 | off                                            | Tries to recover malformed input; check the result.                              |\n| `-force`, `-fo`, `-for`, `-forc`                                                | switch                 | off                                            | Writes an output file even when no improvement is found.                         |\n| `-preserve`, `-p`, `-pr`, `-pre`, `-pres`, `-prese`, `-preser`, `-preserv`      | switch                 | off                                            | Keeps file attributes such as permissions and timestamps where possible.         |\n| `-quiet`, `-q`, `-qu`, `-qui`, `-quie`, `-silent`, `-sil`, `-sile`, `-silen`    | switch                 | off                                            | Suppresses normal output.                                                        |\n| `-simulate`, `-sim`, `-simu`, `-simul`, `-simula`, `-simulat`                   | switch                 | off                                            | Runs the optimization without writing files.                                     |\n| `-f`                                                                            | set/ranges 0–5         | 0,5 at level 2                                 | Row filters to try: 0–4 fixed, 5 adaptive. Accepts lists and ranges such as 0,5. |\n| `-i`                                                                            | integer 0–1            | retain input interlace                         | Output interlacing: 0 none, 1 Adam7.                                             |\n| `-zc`                                                                           | set/ranges 1–9         | 9 at level 2                                   | zlib compression levels to try, 1–9.                                             |\n| `-zm`                                                                           | set/ranges 1–9         | 8 at level 2                                   | zlib memory levels to try, 1–9.                                                  |\n| `-zs`                                                                           | set/ranges 0–3         | 0–3 at level 2                                 | zlib strategies to try: 0 default, 1 filtered, 2 Huffman-only, 3 RLE.            |\n| `-zw`                                                                           | power-of-two size      | libpng default 32 KiB; smaller for Huffman/RLE | zlib window size, 256 to 32768 bytes; accepts suffixes like 4k.                  |\n| `-full`, `-fu`, `-ful`                                                          | switch                 | off                                            | Produces a full IDAT report, which can slow the search.                          |\n| `-nb`                                                                           | switch                 | off                                            | Disables bit-depth reduction.                                                    |\n| `-nc`                                                                           | switch                 | off                                            | Disables colour-type reduction.                                                  |\n| `-np`                                                                           | switch                 | off                                            | Disables palette reduction.                                                      |\n| `-nx`                                                                           | switch                 | off                                            | Disables all three reductions.                                                   |\n| `-nz`                                                                           | switch                 | off                                            | Skips IDAT recompression unless a reduction needs it.                            |\n| `-snip`, `-sn`, `-sni`                                                          | switch                 | off                                            | Extracts one image from an animated or multi-image file and drops the rest.      |\n| `-strip`, `-st`, `-str`, `-stri`                                                | object                 | not enabled                                    | Only all is accepted; individual chunks cannot be named.                         |\n| `-v`                                                                            | switch                 | off                                            | Verbose output; with no input files, prints the version and copyright.           |\n| `-verbose`, `-verb`, `-verbo`, `-verbos`                                        | switch                 | off                                            | Verbose output only.                                                             |\n| `-version`, `-vers`, `-versi`, `-versio`                                        | action                 | not requested                                  | Prints the version when no input files are given.                                |\n| `-debug`                                                                        | switch                 | off                                            | Enables internal debug features; cannot be abbreviated.                          |\n| `-log`, `-lo`                                                                   | removed option         | not supported                                  | Removed; the parser rejects it. Redirect output with the shell instead.          |\n| `-help`, `-?`, `-h`, `-he`, `-hel`                                              | action                 | not requested                                  | Shows extended help.                                                             |\n| `--`                                                                            | action                 | not requested                                  | Ends option parsing so later arguments are input paths.                          |\n\n</details>\n\nThe default `-o2` searches `-zc9 -zm8 -zs0-3 -f0,5`. Higher levels search more combinations but never add visual loss. Repeated `-f` and `-z*` sets are unioned. `-strip` accepts only `all`. `-snip` extracts a single image from an animated or multi-image input and discards the animation. See the [versioned manual](https://optipng.sourceforge.net/optipng-7.9.1.man1.html).\n\n## pngquant parameter reference\n\nThis is the Rust frontend (3.0.3). The optional positional `ncolors` is the same as the hidden `--colors`.\n\n<details>\n<summary>Complete pngquant 3.0.3 Rust options and defaults</summary>\n\n| Parameter and aliases | Type / accepted values | Default                              | Meaning and limits                                                                                      |\n| --------------------- | ---------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------- |\n| `--colors`            | integer 2–256          | 256 maximum                          | Maximum palette size, 2–256; the positional ncolors argument sets the same limit.                       |\n| `--quality`, `-Q`     | min-max in 0–100       | no minimum; target 100               | Quality range min-max, 0–100. Below min the image is refused (exit 99). A single N means 90% of N to N. |\n| `--speed`, `-s`       | integer 1–11           | 4                                    | 1 (slowest, best) to 11 (fastest); 10 compresses the PNG faster, 11 also disables dithering.            |\n| `--floyd`             | optional float         | 1                                    | Floyd–Steinberg dithering strength 0–1; write --floyd=0.5.                                              |\n| `--nofs`, `--ordered` | switch                 | off                                  | Disables dithering; --ordered is an alias.                                                              |\n| `--posterize`         | integer 0–4            | 0                                    | Drops this many low bits of colour precision, 0–4; lossy but smaller.                                   |\n| `--strip`             | switch                 | off                                  | Removes optional metadata chunks.                                                                       |\n| `--map`               | PNG path               | not specified                        | Uses the colours of this PNG as a fixed palette.                                                        |\n| `--ext`               | suffix                 | -fs8.png; -or8.png without dithering | Output filename suffix for batch runs; cannot combine with --output.                                    |\n| `--output`, `-o`      | path                   | derived suffix; stdout for stdin     | Single output file; - writes to stdout.                                                                 |\n| `--force`, `-f`       | switch                 | off                                  | Overwrites existing output files without a backup.                                                      |\n| `--no-force`          | switch                 | off                                  | Never overwrites existing files, even when --force is also given.                                       |\n| `--skip-if-larger`    | switch                 | off                                  | Writes nothing when the result is not smaller than the input (exit 98).                                 |\n| `--transbug`          | switch                 | off                                  | Puts a transparent entry last in the palette for old, buggy viewers.                                    |\n| `--iebug`             | ignored switch         | off                                  | Accepted but ignored in 3.0.3.                                                                          |\n| `--verbose`, `-v`     | switch                 | off                                  | Prints status and quantization details.                                                                 |\n| `--quiet`, `-q`       | switch                 | off                                  | Accepted but has no effect; output is already quiet unless --verbose is given.                          |\n| `--help`, `-h`        | action                 | not requested                        | Shows help.                                                                                             |\n| `--version`, `-V`     | action                 | not requested                        | Prints the version.                                                                                     |\n| `--`                  | action                 | not requested                        | Ends option parsing so later arguments are the color count and input paths.                             |\n\n</details>\n\n`--quality 65-85` tries a palette that meets 85 and refuses images that cannot reach 65, with exit code **99**; **98** is the `--skip-if-larger` refusal. When reading from stdin the original may be passed through unchanged, so check what the pipeline actually produced. `--iebug` is registered but ignored in this version. The old C-only spellings (`-nofs`, `-fs`) are not accepted. `--nofs` and `--ordered` both mean no error diffusion.\n\n## ZopfliPNG parameter reference\n\nPinned to Google's source commit `df1517dd8518` (30 September 2026); there is no versioned release. Long-option values are attached with `=`.\n\n<details>\n<summary>Complete pinned Google ZopfliPNG options and defaults</summary>\n\n| Parameter and aliases | Type / accepted values                  | Default                                | Meaning and limits                                                                                                        |\n| --------------------- | --------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |\n| `-m`                  | repeatable switch                       | off (15/5 iterations)                  | Multiplies the iteration counts by 4; repeat for more.                                                                    |\n| `-y`                  | switch                                  | off                                    | Overwrites existing output without asking; a smaller earlier output is still kept.                                        |\n| `-d`                  | switch                                  | off                                    | Dry run: prints sizes without saving.                                                                                     |\n| `-q`                  | switch                                  | off                                    | Fast compression without Zopfli; for quickly trying filters and colour types.                                             |\n| `--prefix`            | optional text attached with =           | not enabled; `zopfli_` when bare       | Batch mode: writes prefixed copies of each input, optionally into a directory. Use --prefix=name.                         |\n| `--always_zopflify`   | switch                                  | off                                    | Writes the Zopfli output even when larger than the input; for benchmarking.                                               |\n| `--verbose`           | switch                                  | off                                    | Prints a detailed coding report.                                                                                          |\n| `--lossy_transparent` | switch                                  | off                                    | Discards RGB values behind fully transparent pixels.                                                                      |\n| `--lossy_8bit`        | switch                                  | off                                    | Converts 16-bit channels to 8-bit; lossy.                                                                                 |\n| `--iterations`        | integer attached with =                 | 15 below 200000 raw bytes; 5 otherwise | Zopfli iterations for any file size; more is slower and slightly smaller. Minimum 1.                                      |\n| `--splitting`         | ignored compatibility argument          | ignored                                | Ignored; kept for backward compatibility.                                                                                 |\n| `--filters`           | characters attached with =              | automatic fast selection               | Strategies to try: 0–4 fixed, m MinSum, e entropy, p input filters, b brute force. 0me is a good set.                     |\n| `--keepchunks`        | comma-separated four-letter chunk names | none (IHDR,PLTE,tRNS,IDAT,IEND only)   | Extra chunks to keep, as exact four-letter names separated by commas (iCCP,gAMA). bKGD or sBIT also pins the colour type. |\n| `--keepcolortype`     | switch                                  | off                                    | Keeps the input colour type and bit depth, at some cost in compression.                                                   |\n| `--help`, `-h`        | action                                  | not requested                          | Shows help.                                                                                                               |\n\n</details>\n\nThe default iteration split depends on the raw DEFLATE input size (15 below 200,000 bytes, otherwise 5). An existing output file is treated as a previous candidate and kept if smaller. ZopfliPNG returns success on some failure paths, so confirm the output exists and decodes. By default it keeps only `IHDR`, `PLTE`, `tRNS`, `IDAT` and `IEND`, which removes colour profiles; list the ones the image needs, such as `--keepchunks=iCCP,sRGB,gAMA,cHRM,cICP`; names are exact four-letter, case-sensitive and comma-separated with no spaces. It is not an APNG optimiser.\n"
}
