{
    "mode": "man",
    "parameter": "pbmclean",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/pbmclean/1/json",
    "generated": "2026-06-03T03:33:52Z",
    "synopsis": "pbmclean [-minneighbors=N] [-black|-white] [pbmfile]\nYou  can use the minimum unique abbreviation of the options.  You can use two hyphens instead\nof one.  You can separate an option name from its value with white space instead of an equals\nsign.\nBefore December 2001, pbmclean accepted -N instead of -minneighbors.",
    "sections": {
        "NAME": {
            "content": "pbmclean - flip isolated pixels in portable bitmap\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "pbmclean [-minneighbors=N] [-black|-white] [pbmfile]\n\nYou  can use the minimum unique abbreviation of the options.  You can use two hyphens instead\nof one.  You can separate an option name from its value with white space instead of an equals\nsign.\n\nBefore December 2001, pbmclean accepted -N instead of -minneighbors.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "pbmclean  cleans up a PBM image of random specs.  It reads a PBM image as input and outputs a\nPBM that is the same as the input except with every pixel which has  less  than  N  identical\nneighbours inverted.\n\nThe default for N is 1 - only completely isolated pixels are flipped.\n\n(A  value  of N greater than 8 generates a completely inverted image (but use pnminvert to do\nthat) -- or a completely white or completely black image with the -black or -white option).\n\npbmclean considers the area beyond the edges of the image to be white.   (This  matters  when\nyou consider pixels right on the edge of the image).\n\nYou can use pbmclean to clean up \"snow\" on bitmap images.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-black",
                    "content": ""
                },
                {
                    "name": "-white -black",
                    "content": "-white, pbmclean flips both black and white pixels which do not have sufficient  iden‐\ntical  neighbors.   If  you specify -black, pbmclean leaves the white pixels alone and\njust erases isolated black pixels.  Vice versa  for  -white.   You  may  specify  both\n-black and -white to get the same as the default behavior.\n\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "pbm(5)\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright  (C)  1990 by Angus Duggan Copyright (C) 1989 by Jef Poskanzer.  Copyright (C) 2001\nby Michael Sternberg.\n\nPermission to use, copy, modify, and distribute this software and its documentation  for  any\npurpose and without fee is hereby granted, provided that the above copyright notice appear in\nall copies and that both that copyright notice and this permission notice appear in  support‐\ning documentation.  This software is provided \"as is\" without express or implied warranty.\n\n\n\n18 Oct 2001                                 pbmclean(1)",
            "subsections": []
        }
    },
    "summary": "pbmclean - flip isolated pixels in portable bitmap",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "-white, pbmclean flips both black and white pixels which do not have sufficient iden‐ tical neighbors. If you specify -black, pbmclean leaves the white pixels alone and just erases isolated black pixels. Vice versa for -white. You may specify both -black and -white to get the same as the default behavior."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "pbm",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/pbm/5/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Clean up a PBM image by erasing isolated black and white pixels.",
        "examples": [
            {
                "description": "Clean up a PBM image by erasing isolated black and white pixels",
                "command": "pbmclean {{path/to/image.pbm}} > {{path/to/output.pbm}}"
            },
            {
                "description": "Clean up only black/white pixels",
                "command": "pbmclean -{{black|white}} {{path/to/image.pbm}} > {{path/to/output.pbm}}"
            },
            {
                "description": "Specify the minimum number of neighbouring pixels of the same color in order for a pixel not to be considered isolated",
                "command": "pbmclean {{-m|-minneighbours}} {{3}} {{path/to/image.pbm}} > {{path/to/output.pbm}}"
            }
        ]
    }
}