{
    "content": [
        {
            "type": "text",
            "text": "# pamcut (man)\n\n## NAME\n\npamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image\n\n## DESCRIPTION\n\nThis program is part of Netpbm(1).\n\n## TLDR\n\n> Cut out a rectangular region from a Netpbm image.\n\n- Discard the specified number of columns/rows on each side of the image:\n  `pamcut {{-cropl|-cropleft}} {{value}} {{-cropr|-cropright}} {{value}} {{-cropt|-croptop}} {{value}} {{-cropb|-cropbottom}} {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}`\n- Keep only the columns between the specified columns (inclusively):\n  `pamcut {{-l|-left}} {{value}} {{-ri|-right}} {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}`\n- Fill missing areas with black pixels if the specified rectangle does not entirely lie within the input image:\n  `pamcut {{-t|-top}} {{value}} {{-b|-bottom}} {{value}} -pad {{path/to/image.ppm}} > {{path/to/output.ppm}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS** (1 subsections)\n- **DESCRIPTION** (3 subsections)\n- **OPTIONS** (12 subsections)\n- **SEE ALSO**\n- **HISTORY**\n- **AUTHOR**\n- **DOCUMENT SOURCE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "pamcut",
        "section": "",
        "mode": "man",
        "summary": "pamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image",
        "synopsis": "",
        "tldr_summary": "Cut out a rectangular region from a Netpbm image.",
        "tldr_examples": [
            {
                "description": "Discard the specified number of columns/rows on each side of the image",
                "command": "pamcut {{-cropl|-cropleft}} {{value}} {{-cropr|-cropright}} {{value}} {{-cropt|-croptop}} {{value}} {{-cropb|-cropbottom}} {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}"
            },
            {
                "description": "Keep only the columns between the specified columns (inclusively)",
                "command": "pamcut {{-l|-left}} {{value}} {{-ri|-right}} {{value}} {{path/to/image.ppm}} > {{path/to/output.ppm}}"
            },
            {
                "description": "Fill missing areas with black pixels if the specified rectangle does not entirely lie within the input image",
                "command": "pamcut {{-t|-top}} {{value}} {{-b|-bottom}} {{value}} -pad {{path/to/image.ppm}} > {{path/to/output.ppm}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The column number of the leftmost column to be in the output. Columns left of this get cut out. If a nonnegative number, it refers to columns numbered from 0 at the left, increasing to the right. If negative, it refers to columns numbered -1 at the right, decreasing to the left."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The column number of the rightmost column to be in the output, numbered the same as for -left. Columns to the right of this get cut out."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The row number of the topmost row to be in the output. Rows above this get cut out. If a nonnegative number it refers to rows numbered from 0 at the top, increasing down‐ ward. If negative, it refers to columns numbered -1 at the bottom, decreasing upward."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The row number of the bottom-most row to be in the output, numbered the same as for -top. Rows below this get cut out."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The number of columns to be in the output. Must be positive."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "The number of rows to be in the output. Must be positive."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "These options tell how many rows or columns to crop from the left, right, top, or bot‐ tom edges, respectively. The value must not be negative. These option were new in Netpbm 10.85 (December 2018). Before that, you can achieve the same thing with -left, top, and negative values for -right and -bottom. Remember to subtract one in the latter case; e.g. the equivalent of -cropright=1 is -right=-2."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "less you also specify -pad. In that case, it pads the output with black up to the edges you specify. You can use this option if you need to have an image of certain dimensions and have an image of arbitrary dimensions. pnmpad also adds borders to an image, but you specify their width directly. pamcomp does a more general form of this padding. Create a background image of the frame dimensions and overlay the subject image on it. You can use options to have the subject image in the center of the frame or against any edge and make the padding any color (the padding color is the color of the background image)."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print information about the processing to Standard Error."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "pnmcrop",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmcrop/1/json"
            },
            {
                "name": "pamdice",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamdice/1/json"
            },
            {
                "name": "pamcomp",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamcomp/1/json"
            },
            {
                "name": "pnmpad",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pnmpad/1/json"
            },
            {
                "name": "pamcat",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pamcat/1/json"
            },
            {
                "name": "pgmslice",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pgmslice/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": 1,
                "subsections": [
                    {
                        "name": "pamcut",
                        "lines": 33
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 23,
                "subsections": [
                    {
                        "name": "-bottom -height  -cropright",
                        "lines": 10
                    },
                    {
                        "name": "-width  -height",
                        "lines": 1
                    },
                    {
                        "name": "-right  -bottom",
                        "lines": 17
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 5,
                "subsections": [
                    {
                        "name": "-left=_",
                        "lines": 6
                    },
                    {
                        "name": "-right=_",
                        "lines": 4
                    },
                    {
                        "name": "-top=_",
                        "lines": 5
                    },
                    {
                        "name": "-bottom=_",
                        "lines": 4
                    },
                    {
                        "name": "-width=_",
                        "lines": 3
                    },
                    {
                        "name": "-height=_",
                        "lines": 3
                    },
                    {
                        "name": "-cropleft",
                        "lines": 1
                    },
                    {
                        "name": "-cropright",
                        "lines": 1
                    },
                    {
                        "name": "-croptop",
                        "lines": 1
                    },
                    {
                        "name": "-cropbottom",
                        "lines": 10
                    },
                    {
                        "name": "-pad",
                        "lines": 12
                    },
                    {
                        "name": "-verbose",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DOCUMENT SOURCE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image\n\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": [
                    {
                        "name": "pamcut",
                        "content": "[-left colnum]\n\n[-right colnum]\n\n[-top rownum]\n\n[-bottom rownum]\n\n[-width cols]\n\n[-height rows]\n\n[-pad]\n\n[-cropleft numcols]\n\n[-cropright numcols]\n\n[-croptop numrows]\n\n[-cropbottom numrows]\n\n[-verbose]\n\n[left top width height]\n\n[pnmfile]\n\nMinimum unique abbreviations of option are acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n"
                    }
                ]
            },
            "DESCRIPTION": {
                "content": "This program is part of Netpbm(1).\n\npamcut reads a PAM, PBM, PGM, or PPM image as input and extracts the specified rectangle, and\nproduces the same kind of image as output.\n\nYou can specify either the rectangle to cut out and keep or specify the edges to crop off and\ndiscard, or a combination.\n\nTo request edges be cropped off, use options -cropleft, -cropright, -croptop, and -cropbottom\nto indicate how many rows or columns to discard.\n\nFor  example,  -cropleft=50 -cropright=200 means to discard the leftmost 50 and rightmost 200\ncolumns.\n\nTo specify the rectangle to keep, use -left, -right, -top, -bottom, -width, -height, and -pad\noptions.\n\nFor example, -left=50 -right=200 means to keep the 150 columns between Columns 50 and 200 in‐\nclusive.\n\nYou can code any mixture of the options.  What you don't specify  defaults.   Those  defaults\nare  in  favor of minimal cutting and in favor of cutting the right and bottom edges off.  It\nis an error to overspecify, i.e. to specify all three of -left, -right, and -width  or  -top,",
                "subsections": [
                    {
                        "name": "-bottom -height  -cropright",
                        "content": "There is an older way to specify the rectangle to keep: positional arguments.  Arguments were\nthe  only  way  available  before July 2000, but you should not use them in new applications.\nOptions are easier to remember and read, more expressive, and allow you to use defaults.\n\nIf you use both options and arguments, the two specifications get  mixed  in  an  unspecified\nway.\n\nTo  use  arguments, specify all four of the left, top, width, and height arguments.  left and\ntop have the same effect as specifying them as the argument of a -left or  -top  option,  re‐\nspectively.   width  and  height have the same effect as specifying them as the argument of a"
                    },
                    {
                        "name": "-width  -height",
                        "content": "tive,  they  have  the same effect as specifying one less than the value as the argument to a"
                    },
                    {
                        "name": "-right  -bottom",
                        "content": "right edge).  Before July 2000, negative numbers were not allowed for width and height.\n\nInput is from Standard Input if you don't specify the input file pnmfile.\n\nOutput is to Standard Output.\n\npamcut  works  on  a  multi-image stream.  It cuts each image in the stream independently and\nproduces a multi-image stream output.  Before Netpbm 10.32 (March 2006), it ignored  all  but\nthe first image in the stream.\n\nIf  you  are  splitting  a single image into multiple same-size images, pamdice is faster and\neasier than running pamcut multiple times.\n\npamcomp is also useful for cutting and padding an image to a  certain  size.   You  create  a\nbackground image of the desired frame dimensions and overlay the subject image on it.\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\\ ), pamcut recognizes the following command line options:\n\n\n",
                "subsections": [
                    {
                        "name": "-left=_",
                        "content": "The column number of the leftmost column to be in the output.  Columns  left  of  this\nget  cut  out.   If  a nonnegative number, it refers to columns numbered from 0 at the\nleft, increasing to the right.  If negative, it refers to columns numbered -1  at  the\nright, decreasing to the left.\n\n"
                    },
                    {
                        "name": "-right=_",
                        "content": "The  column  number  of the rightmost column to be in the output, numbered the same as\nfor -left.  Columns to the right of this get cut out.\n\n"
                    },
                    {
                        "name": "-top=_",
                        "content": "The row number of the topmost row to be in the output.  Rows above this get  cut  out.\nIf a nonnegative number it refers to rows numbered from 0 at the top, increasing down‐\nward.  If negative, it refers to columns numbered -1 at the bottom, decreasing upward.\n\n"
                    },
                    {
                        "name": "-bottom=_",
                        "content": "The  row  number  of the bottom-most row to be in the output, numbered the same as for\n-top.  Rows below this get cut out.\n\n"
                    },
                    {
                        "name": "-width=_",
                        "content": "The number of columns to be in the output.  Must be positive.\n\n"
                    },
                    {
                        "name": "-height=_",
                        "content": "The number of rows to be in the output.  Must be positive.\n\n"
                    },
                    {
                        "name": "-cropleft",
                        "content": ""
                    },
                    {
                        "name": "-cropright",
                        "content": ""
                    },
                    {
                        "name": "-croptop",
                        "content": ""
                    },
                    {
                        "name": "-cropbottom",
                        "content": "These options tell how many rows or columns to crop from the left, right, top, or bot‐\ntom edges, respectively.\n\nThe value must not be negative.\n\nThese option were new in Netpbm 10.85 (December 2018).  Before that, you  can  achieve\nthe  same thing with -left, top, and negative values for -right and -bottom.  Remember\nto subtract one in the latter case; e.g. the equivalent of -cropright=1 is -right=-2.\n\n"
                    },
                    {
                        "name": "-pad",
                        "content": "less  you  also  specify  -pad.  In that case, it pads the output with black up to the\nedges you specify.  You can use this option if you need to have an  image  of  certain\ndimensions and have an image of arbitrary dimensions.\n\npnmpad also adds borders to an image, but you specify their width directly.\n\npamcomp  does  a  more general form of this padding.  Create a background image of the\nframe dimensions and overlay the subject image on it.  You can use options to have the\nsubject image in the center of the frame or against any edge and make the padding  any\ncolor (the padding color is the color of the background image).\n\n"
                    },
                    {
                        "name": "-verbose",
                        "content": "Print information about the processing to Standard Error.\n\n\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "pnmcrop(1), pamdice(1), pamcomp(1), pnmpad(1), pamcat(1), pgmslice(1), pnm(1)\n\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "pamcut  was  derived  from pnmcut in Netpbm 9.20 (May 2001).  It was the first Netpbm program\nadapted to the new PAM format and programming library.\n\nThe predecessor pnmcut was one of the oldest tools in the Netpbm package.\n\n\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Copyright (C) 1989 by Jef Poskanzer.\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/pamcut.html\n\nnetpbm documentation                       04 October 2019                     Pamcut User Manual(1)",
                "subsections": []
            }
        }
    }
}