{
    "content": [
        {
            "type": "text",
            "text": "# pnmquant (man)\n\n## NAME\n\npnmquant - quantize the colors in a Netpbm image to a smaller set\n\n## SYNOPSIS\n\npnmquant   [-center|-meancolor|-meanpixel]   [-floyd|-fs]   [-nofloyd|-nofs]  [-spreadbright‐\nness|-spreadluminosity] {[-norandom]|[-randomseed=n]} ncolors [pnmfile]\nAll options can be abbreviated to their shortest unique prefix.  You may use two hyphens  in‐\nstead  of one to designate an option.  You may use either white space or equals signs between\nan option name and its value.\n\n## DESCRIPTION\n\nThis program is part of Netpbm(1).\n\n## TLDR\n\n> Quantize the colors in a PNM image into a smaller set.\n\n- Generate an image using only `n_colors` or less colors as close as possible to the input image:\n  `pnmquant {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **OPTIONS** (14 subsections)\n- **HISTORY** (2 subsections)\n- **SEE ALSO**\n- **DOCUMENT SOURCE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pnmquant",
        "section": "",
        "mode": "man",
        "summary": "pnmquant - quantize the colors in a Netpbm image to a smaller set",
        "synopsis": "pnmquant   [-center|-meancolor|-meanpixel]   [-floyd|-fs]   [-nofloyd|-nofs]  [-spreadbright‐\nness|-spreadluminosity] {[-norandom]|[-randomseed=n]} ncolors [pnmfile]\nAll options can be abbreviated to their shortest unique prefix.  You may use two hyphens  in‐\nstead  of one to designate an option.  You may use either white space or equals signs between\nan option name and its value.",
        "tldr_summary": "Quantize the colors in a PNM image into a smaller set.",
        "tldr_examples": [
            {
                "description": "Generate an image using only `n_colors` or less colors as close as possible to the input image",
                "command": "pnmquant {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.pnm}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pnmcolormap",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmcolormap/1/json"
            },
            {
                "name": "pnmremap",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmremap/1/json"
            },
            {
                "name": "pnmquantall",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmquantall/1/json"
            },
            {
                "name": "pamdepth",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamdepth/1/json"
            },
            {
                "name": "ppmdither",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmdither/1/json"
            },
            {
                "name": "ppmquant",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ppmquant/1/json"
            },
            {
                "name": "pnm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnm/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 28,
                "subsections": [
                    {
                        "name": "Running pnmcolormap and pnmremap Separately",
                        "lines": 18
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 4,
                "subsections": [
                    {
                        "name": "Options Passed to pnmcolormap",
                        "lines": 4
                    },
                    {
                        "name": "-center",
                        "lines": 1
                    },
                    {
                        "name": "-meancolor",
                        "lines": 1
                    },
                    {
                        "name": "-meanpixel",
                        "lines": 1
                    },
                    {
                        "name": "-spreadbrightness",
                        "lines": 1
                    },
                    {
                        "name": "-spreadluminosity",
                        "lines": 1
                    },
                    {
                        "name": "Options Passed to pnmremap",
                        "lines": 5
                    },
                    {
                        "name": "-floyd",
                        "lines": 1
                    },
                    {
                        "name": "-fs",
                        "lines": 1
                    },
                    {
                        "name": "-nofloyd",
                        "lines": 1
                    },
                    {
                        "name": "-nofs",
                        "lines": 1
                    },
                    {
                        "name": "-norandom",
                        "lines": 1
                    },
                    {
                        "name": "-randomseed",
                        "lines": 1
                    },
                    {
                        "name": "-norandom",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "HISTORY",
                "lines": 4,
                "subsections": [
                    {
                        "name": "-version",
                        "lines": 1
                    },
                    {
                        "name": "-norandom",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DOCUMENT SOURCE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pnmquant - quantize the colors in a Netpbm image to a smaller set\n\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "pnmquant   [-center|-meancolor|-meanpixel]   [-floyd|-fs]   [-nofloyd|-nofs]  [-spreadbright‐\nness|-spreadluminosity] {[-norandom]|[-randomseed=n]} ncolors [pnmfile]\n\nAll options can be abbreviated to their shortest unique prefix.  You may use two hyphens  in‐\nstead  of one to designate an option.  You may use either white space or equals signs between\nan option name and its value.\n\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This program is part of Netpbm(1).\n\npnmquant reads a PNM image as input.  It chooses ncolors colors to best represent the  image,\nmaps the existing colors to the new ones, and writes a PNM image as output.\n\nThis program is simply a combination of pnmcolormap and pnmremap, where the colors of the in‐\nput  are  remapped  using  a color map which is generated from the colors in that same input.\nThe options have the same meaning as in those programs.  See their  documentation  to  under‐\nstand pnmquant.\n\nYou may actually get fewer than ncolors colors in the output because\nthe method pnmcolormap uses to choose the best set of colors for the\nimage is not the same as the method pnmremap uses to determine the\nbest color from the set to represent an individual color.  For example,\npnmcolormap may include salmon in the color map as the best\nrepresentative of a pink pixel in the input and include coral in the color\nmap as the best representative of an actual coral pixel in the input.  But\npnmremap is free to use any color in the color map to represent that\npink pixel and would find coral is a closer match for pink than salmon and\ntherefore use coral for pink.  pnmremap might not use salmon\nfor any pixel.\n\nThis waste of a slot in the color map is a consequence of the approximate\nmethod pnmcolormap uses in order to compute the color map with a\npractical amount of computation.\n\n\n",
                "subsections": [
                    {
                        "name": "Running pnmcolormap and pnmremap Separately",
                        "content": "It  is  much faster to call pnmcolormap and pnmremap directly than to run pnmquant.  You save\nthe overhead of the Perl interpreter and creating two extra processes.  pnmquant  is  just  a\nconvenience.\n\nHere is an example of the relationship between the programs:\n\nThis:\n\n$ pnmquant 256 myimage.pnm >/tmp/colormap.pnm >myimage256.pnm\n\n\ndoes essentially this:\n\n$ pnmcolormap 256 myimage.pnm >/tmp/colormap.pnm\n$ pnmremap -mapfile=/tmp/colormap.pnm myimage.pnm >myimage256.pnm\n\n\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), pnmquant recognizes the following command line options:\n\n",
                "subsections": [
                    {
                        "name": "Options Passed to pnmcolormap",
                        "content": "These options control the selection of the palette.  They are options to pnmcolormap(1).\n\n\n"
                    },
                    {
                        "name": "-center",
                        "content": ""
                    },
                    {
                        "name": "-meancolor",
                        "content": ""
                    },
                    {
                        "name": "-meanpixel",
                        "content": ""
                    },
                    {
                        "name": "-spreadbrightness",
                        "content": ""
                    },
                    {
                        "name": "-spreadluminosity",
                        "content": ""
                    },
                    {
                        "name": "Options Passed to pnmremap",
                        "content": "These options control which color from the palette the program uses to\nreplace a pixel of a certain color from the input.  They are options to pnmremap(1).\n\n\n"
                    },
                    {
                        "name": "-floyd",
                        "content": ""
                    },
                    {
                        "name": "-fs",
                        "content": ""
                    },
                    {
                        "name": "-nofloyd",
                        "content": ""
                    },
                    {
                        "name": "-nofs",
                        "content": ""
                    },
                    {
                        "name": "-norandom",
                        "content": ""
                    },
                    {
                        "name": "-randomseed",
                        "content": ""
                    },
                    {
                        "name": "-norandom",
                        "content": ""
                    }
                ]
            },
            "HISTORY": {
                "content": "pnmquant did not exist before Netpbm 9.21 (January 2001).  Before that, ppmquant did the same\nthing, but only on PPM images.  ppmquant continues to exist, but is only  a  front  end  (for\nname compatibility) to pnmquant.\n",
                "subsections": [
                    {
                        "name": "-version",
                        "content": ""
                    },
                    {
                        "name": "-norandom",
                        "content": ""
                    }
                ]
            },
            "SEE ALSO": {
                "content": "pnmcolormap(1), pnmremap(1), pnmquantall(1), pamdepth(1), ppmdither(1), ppmquant(1), pnm(1)\n",
                "subsections": []
            },
            "DOCUMENT SOURCE": {
                "content": "This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/pnmquant.html\n\nnetpbm documentation                      09 February 2019                   Pnmquant User Manual(1)",
                "subsections": []
            }
        }
    }
}