{
    "content": [
        {
            "type": "text",
            "text": "# pnmcrop(1) (man)\n\n## TLDR\n\n> Crop PNM images.\n\n- Remove white borders on a PNM image:\n  `pnmcrop {{-w|-white}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n- Remove borders of the specified color that are on the top and left side of the image:\n  `pnmcrop -bg-color {{color}} {{-t|-top}} {{-l|-left}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n- Determine the color of the borders to be removed by the color of the pixel in the specified corner:\n  `pnmcrop -bg-corner {{topleft|topright|bottomleft|bottomright}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n- Leave a border with a width of `n` pixels. Additionally, specify the behavior if the image is entirely made out of background:\n  `pnmcrop {{-m|-margin}} {{n}} {{-blan|-blank-image}} {{pass|minimize|maxcrop}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** pnmcrop - crop a portable anymap\n\n**Synopsis:** pnmcrop [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnmfile]\nAll  options  may be abbreviated to their shortest unique prefix or specified with double hy‐\nphens.\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — |  |\n| — | — | — |  |\n| — | — | — | pnmcrop removes borders which are of the background color. If at least three of the four corners are the same color, pnm |\n| — | — | — |  |\n| — | — | — |  |\n| — | — | — |  |\n| — | — | — | Remove any bottom border. |\n| — | — | — | Print on Standard Error information about the processing, including exactly how much is being cropped off of which sides |\n\n## See Also\n\n- pnmcut(1)\n- pnmfile(1)\n- pnm(5)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (6 lines)\n- **DESCRIPTION** (6 lines) — 2 subsections\n  - -black (1 lines)\n  - -sides (9 lines)\n- **OPTIONS** (1 lines) — 8 subsections\n  - -white (1 lines)\n  - -black (1 lines)\n  - -sides (13 lines)\n  - -left (1 lines)\n  - -right (1 lines)\n  - -top (1 lines)\n  - -bottom (2 lines)\n  - -verbose (5 lines)\n- **SEE ALSO** (3 lines)\n- **AUTHOR** (5 lines)\n\n## Full Content\n\n### NAME\n\npnmcrop - crop a portable anymap\n\n### SYNOPSIS\n\npnmcrop [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnmfile]\n\nAll  options  may be abbreviated to their shortest unique prefix or specified with double hy‐\nphens.\n\n### DESCRIPTION\n\nReads a PBM, PGM, or PPM image as input.  Removes borders that are the background color,  and\nproduces the same type of image as output.\n\nIf  you  don't  specify otherwise, pnmcrop assumes the background color is whatever color the\ntop left and right corners of the image are and if they are different colors, something  mid‐\nway  between them.  You can specify that the background is white or black with the -white and\n\n#### -black\n\n#### -sides\n\nBy  default,  pnmcrop  chops  off any stripe of background color it finds, on all four sides.\nYou can tell pnmcrop to remove only specific borders with the -left, -right, -top, and  -bot‐‐\ntom options.\n\nIf you want to chop a specific amount off the side of an image, use pnmcut.\n\nIf you want to add different borders after removing the existing ones, use pnmcat or pnmcomp.\n\n### OPTIONS\n\n#### -white\n\n#### -black\n\n#### -sides\n\npnmcrop removes borders which are of the background color.\n\nIf at least three of the four corners are the same color, pnmcrop takes  that  as  the\nbackground color.  If not, pnmcrop looks for two corners of the same color in the fol‐\nlowing order, taking the first found as the background color: top, left,  right,  bot‐\ntom.  If all four corners are different colors, pnmcrop assumes an average of the four\ncolors as the background color.\n\nThe -sides option slows pnmcrop down, as it reads the entire image  to  determine  the\nbackground  color  in  addition to the up to three times that it would read it without\n-sides.\n\n#### -left\n\n#### -right\n\n#### -top\n\n#### -bottom\n\nRemove any bottom border.\n\n#### -verbose\n\nPrint on Standard Error information about the processing, including exactly  how  much\nis being cropped off of which sides.\n\n### SEE ALSO\n\npnmcut(1), pnmfile(1), pnm(5)\n\n### AUTHOR\n\nCopyright (C) 1989 by Jef Poskanzer.\n\n\n\n18 March 2001                                 pnmcrop(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pnmcrop",
        "section": "1",
        "mode": "man",
        "summary": "pnmcrop - crop a portable anymap",
        "synopsis": "pnmcrop [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnmfile]\nAll  options  may be abbreviated to their shortest unique prefix or specified with double hy‐\nphens.",
        "tldr_summary": "Crop PNM images.",
        "tldr_examples": [
            {
                "description": "Remove white borders on a PNM image",
                "command": "pnmcrop {{-w|-white}} {{path/to/image.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Remove borders of the specified color that are on the top and left side of the image",
                "command": "pnmcrop -bg-color {{color}} {{-t|-top}} {{-l|-left}} {{path/to/image.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Determine the color of the borders to be removed by the color of the pixel in the specified corner",
                "command": "pnmcrop -bg-corner {{topleft|topright|bottomleft|bottomright}} {{path/to/image.pnm}} > {{path/to/output.pnm}}"
            },
            {
                "description": "Leave a border with a width of `n` pixels. Additionally, specify the behavior if the image is entirely made out of background",
                "command": "pnmcrop {{-m|-margin}} {{n}} {{-blan|-blank-image}} {{pass|minimize|maxcrop}} {{path/to/image.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": "pnmcrop removes borders which are of the background color. If at least three of the four corners are the same color, pnmcrop takes that as the background color. If not, pnmcrop looks for two corners of the same color in the fol‐ lowing order, taking the first found as the background color: top, left, right, bot‐ tom. If all four corners are different colors, pnmcrop assumes an average of the four colors as the background color. The -sides option slows pnmcrop down, as it reads the entire image to determine the background color in addition to the up to three times that it would read it without -sides."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Remove any bottom border."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print on Standard Error information about the processing, including exactly how much is being cropped off of which sides."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pnmcut",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmcut/1/json"
            },
            {
                "name": "pnmfile",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmfile/1/json"
            },
            {
                "name": "pnm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "-black",
                        "lines": 1
                    },
                    {
                        "name": "-sides",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-white",
                        "lines": 1
                    },
                    {
                        "name": "-black",
                        "lines": 1
                    },
                    {
                        "name": "-sides",
                        "lines": 13
                    },
                    {
                        "name": "-left",
                        "lines": 1
                    },
                    {
                        "name": "-right",
                        "lines": 1
                    },
                    {
                        "name": "-top",
                        "lines": 1
                    },
                    {
                        "name": "-bottom",
                        "lines": 2
                    },
                    {
                        "name": "-verbose",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}