pbmclean
Clean up a PBM image by erasing isolated black and white pixels. tldr-pages
On several platforms
Several platforms
Clean up a PBM image by erasing isolated black and white pixels
pbmclean path/to/image.pbm >path/to/output.pbmIdentifyClean up only black/white pixels
pbmclean -black path/to/image.pbm >path/to/output.pbmIdentifySpecify the minimum number of neighboring pixels of the same color in order for a pixel not to be considered isolated
pbmclean -minneighbors 3 path/to/image.pbm >path/to/output.pbmIdentify