{
    "mode": "man",
    "parameter": "ppmtopgm",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ppmtopgm/1/json",
    "generated": "2026-06-03T00:34:53Z",
    "synopsis": "ppmtopgm [ppmfile]",
    "sections": {
        "NAME": {
            "content": "ppmtopgm - convert a portable pixmap into a portable graymap\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ppmtopgm [ppmfile]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  portable  pixmap as input.  Produces a portable graymap as output.  The output is a\n\"black and white\" rendering of the original image, as in a black and white  photograph.   The\nquantization formula used is .299 r + .587 g + .114 b.\n\nNote  that  although  there is a pgmtoppm program, it is not necessary for simple conversions\nfrom pgm to ppm , because any ppm program can read pgm (and pbm ) files automatically.   pgm‐‐\ntoppm  is  for  colorizing a pgm file.  Also, see ppmtorgb3 for a different way of converting\ncolor to gray.  And ppmdist generates a grayscale image from a color image, but in a way that\nmakes  it  easy to differentiate the original colors, not necessarily a way that looks like a\nblack and white photograph.\n\n",
            "subsections": []
        },
        "QUOTE": {
            "content": "Cold-hearted orb that rules the night\nRemoves the colors from our sight\nRed is gray, and yellow white\nBut we decide which is right\nAnd which is a quantization error.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pgmtoppm(1),ppmtorgb3(1),rgb3toppm(1),ppmdist(1),ppm(5),pgm(5)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (C) 1989 by Jef Poskanzer.\n\n\n\n10 April 2000                                ppmtopgm(1)",
            "subsections": []
        }
    },
    "summary": "ppmtopgm - convert a portable pixmap into a portable graymap",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pgmtoppm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pgmtoppm/1/json"
        },
        {
            "name": "ppmtorgb3",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppmtorgb3/1/json"
        },
        {
            "name": "rgb3toppm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/rgb3toppm/1/json"
        },
        {
            "name": "ppmdist",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppmdist/1/json"
        },
        {
            "name": "ppm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/ppm/5/json"
        },
        {
            "name": "pgm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pgm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Convert a PPM image to a PGM image.",
        "examples": [
            {
                "description": "Convert PPM image to PGM image",
                "command": "ppmtopgm {{path/to/file.ppm}} > {{path/to/file.pgm}}"
            },
            {
                "description": "Display version",
                "command": "ppmtopgm {{-v|-version}}"
            }
        ]
    }
}