{
    "mode": "man",
    "parameter": "ppmcolormask",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ppmcolormask/1/json",
    "generated": "2026-06-03T00:21:30Z",
    "synopsis": "ppmcolormask color [ppmfile]",
    "sections": {
        "NAME": {
            "content": "ppmcolormask - produce mask of areas of a certain color in a PPM file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ppmcolormask color [ppmfile]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Reads  a  PPM file as input.  Produces a PBM (bitmap) file as output.  The output file is the\nsame dimensions as the input file and is black in all places where  the  input  file  is  the\ncolor color, and white everywhere else.\n\nThe  output  of  ppmcolormask is useful as an alpha mask input to pnmcomp.  Note that you can\ngenerate such an alpha mask automatically as you convert to PNG format with pnmtopng(1).  Use\nits -transparent option.\n\nppmfile is the input file.  If you don't specify ppmfile, the input is from Standard Input.\n\nThe output goes to Standard Output.\n\nYou can specify color five ways:\n\no      An X11-style color name (e.g.  black).\n\no      An  X11-style hexadecimal specifier: rgb:r/g/b, where r g and b are each 1- to 4-digit\nhexadecimal numbers.\n\no      An X11-style decimal specifier: rgbi:r/g/b, where r g and b are floating point numbers\nbetween 0 and 1.\n\no      For  backwards  compatibility,  an  old-X11-style  hexadecimal  number: #rgb, #rrggbb,\n#rrrgggbbb, or #rrrrggggbbbb.\n\no      For backwards compatibility, a triplet of numbers separated by commas: r,g,b, where  r\ng  and b are floating point numbers between 0 and 1.  (This style was added before MIT\ncame up with the similar rgbi style.)\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pgmtoppm(1), pnmcomp(1), pbmmask(1), ppm(5)\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Bryan Henderson (bryanh@giraffe-data.com)\n\n\n\n\n14 April 2000                            ppmcolormask(1)",
            "subsections": []
        }
    },
    "summary": "ppmcolormask - produce mask of areas of a certain color in a PPM file",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "pgmtoppm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pgmtoppm/1/json"
        },
        {
            "name": "pnmcomp",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pnmcomp/1/json"
        },
        {
            "name": "pbmmask",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbmmask/1/json"
        },
        {
            "name": "ppm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/ppm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Produce a mask of areas of a certain color in a PPM image.",
        "examples": [
            {
                "description": "Produce a mask of areas of a certain color in the specified PPM image",
                "command": "ppmcolormask {{-c|-color}} {{red,blue}} {{path/to/input.ppm}} > {{path/to/output.pbm}}"
            }
        ]
    }
}