{
    "mode": "info",
    "parameter": "pnmcrop",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/pnmcrop/json",
    "generated": "2026-07-05T11:49:04Z",
    "synopsis": "pnmcrop  [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnm-\nfile]\nAll options may be abbreviated to their shortest unique prefix or spec-\nified with double hyphens.",
    "sections": {
        "NAME": {
            "content": "pnmcrop - crop a portable anymap\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pnmcrop  [-white|-black|-sides] [-left] [-right] [-top] [-bottom] [pnm-\nfile]\n\nAll options may be abbreviated to their shortest unique prefix or spec-\nified with double hyphens.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a PBM, PGM, or PPM image as input.  Removes borders that are the\nbackground color, and produces the same type of image as output.\n\nIf you don't specify otherwise, pnmcrop assumes the background color is\nwhatever  color  the top left and right corners of the image are and if\nthey are different colors, something  midway  between  them.   You  can\nspecify  that  the  background  is  white  or black with the -white and\n-black options or make pnmcrop base its guess on all four  corners  in-\nstead of just two with -sides.\n\nBy  default, pnmcrop chops off any stripe of background color it finds,\non all four sides.  You can tell pnmcrop to remove only  specific  bor-\nders with the -left, -right, -top, and -bottom options.\n\nIf you want to chop a specific amount off the side of an image, use pn-\nmcut.\n\nIf you want to add different borders after removing the existing  ones,\nuse pnmcat or pnmcomp.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-white Take  white to be the background color.  pnmcrop removes borders\nwhich are white.\n\n-black Take black to be the background color.  pnmcrop removes  borders\nwhich are black.\n\n-sides Determine  the background color from the colors of the four cor-\nners of the input image.  pnmcrop removes borders which  are  of\nthe background color.\n\nIf  at  least three of the four corners are the same color, pnm-\ncrop takes that as the background color.  If not, pnmcrop  looks\nfor two corners of the same color in the following order, taking\nthe first found as the background color: top, left, right,  bot-\ntom.   If all four corners are different colors, pnmcrop assumes\nan average of the four colors as the background color.\n\nThe -sides option slows pnmcrop down, as it reads the entire im-\nage  to  determine the background color in addition to the up to\nthree times that it would read it without -sides.\n\n-left  Remove any left border.\n\n-right Remove any right border.\n\n-top   Remove any top border.\n",
            "subsections": [
                {
                    "name": "-bottom",
                    "content": "Remove any bottom border.\n"
                },
                {
                    "name": "-verbose",
                    "content": "Print on Standard Error information about  the  processing,  in-\ncluding exactly how much is being cropped off of which sides.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pnmcut(1), pnmfile(1), pnm(5)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (C) 1989 by Jef Poskanzer.\n\n18 March 2001                      pnmcrop(1)",
            "subsections": []
        }
    },
    "summary": "pnmcrop - crop a portable anymap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Remove any bottom border."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Print on Standard Error information about the processing, in- cluding 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"
        }
    ]
}