Debian Codegraph @

upstream/debian-unstable/man1/pbmclean.1

raw
1 \
2 .\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
3 .\" Do not hand-hack it! If you have bug fixes or improvements, please find
4 .\" the corresponding HTML page on the Netpbm website, generate a patch
5 .\" against that, and send it to the Netpbm maintainer.
6 .TH "Pbmclean User Manual" 1 "19 November 2011" "netpbm documentation"
7
8 .SH NAME
9 pbmclean - despeckle a PBM image
10
11 .UN synopsis
12 .SH SYNOPSIS
13
14 \fBpbmclean\fP
15 [\fB-minneighbors=\fP\fIN\fP]
16 [\fB-black\fP|\fB-white\fP]
17 [\fB-extended\fP]
18 [\fIpbmfile\fP]
19
20 .SH OPTION USAGE
21 .PP
22 You can use the minimum unique abbreviation of the options. You
23 can use two hyphens instead of one. You can separate an option name
24 from its value with white space instead of an equals sign.
25
26 .UN description
27 .SH DESCRIPTION
28 .PP
29 This program is part of
30 .BR "Netpbm" (1)\c
31 \&.
32 .PP
33 \fBpbmclean\fP cleans up a PBM image of random specks. It reads a
34 PBM image as input and outputs a PBM that is the same as the input
35 except with isolated pixels inverted.
36 .PP
37 You can use \fBpbmclean \fP to clean up "snow" on bitmap
38 images.
39 .PP
40 There are two ways \fBpbmclean\fP can define "isolated" pixels:
41 simple and extended. When you specify \fB-extended\fP, \fBpbmclean\fP
42 uses extended; otherwise it uses basic.
43
44 .UN basic
45 .SS Basic Mode
46 .PP
47 In basic mode, \fBpbmclean\fP looks at each pixel individually, and any
48 pixel that doesn't have at least a minimum number of pixels of the same color
49 touching it is considered isolated and \fBpbmclean\fP erases it.
50 .PP
51 The \fB-minneighbors\fP option specifies the minimum number of neighboring
52 pixels of the same color for a pixel \fInot\fP to be considered
53 isolated.
54 .PP
55 For example, if \fB-minneighbors\fP is two and there are two contiguous
56 black pixels in an otherwise white field, each of those pixels is isolated,
57 so \fBpbmclean\fP erases them - turns both white.
58 .PP
59 The default minimum 1 pixel - \fBpbmclean\fP flips only completely
60 isolated pixels.
61 .PP
62 (A \fB-minneighbors\fP value greater than 8 generates a completely
63 inverted image (but use \fBpnminvert\fP to do that) -- or a
64 completely white or completely black image with the \fB-black\fP or
65 \fB-white\fP option).
66 .PP
67 \fBpbmclean\fP considers the area beyond the edges of the image to
68 be white. (This matters when you consider pixels right on the edge of
69 the image).
70 .PP
71 \fBpbmclean\fP does not distinguish between foreground and background; by
72 default, it flips isolated pixels of either color. But you can
73 specify \fB-black\fP or \fB-white\fP to have it flip only pixels of one
74 color.
75
76 .UN extended
77 .SS Extended Mode
78 .PP
79 In extended mode, \fBpbmclean\fP erases all blobs which don't have the
80 specified minimum number of pixels. A blob is a set of contiguous pixels of
81 the foreground color. The minimum number of pixels is one plus
82 the \fB-minneighbors\fP value. You specify the foreground color with
83 \fB-black\fP and \fB-white\fP (default is black).
84 .PP
85 For example, if \fB-minneighbors\fP is 2 and the foreground color is
86 black, and the image contains a straight line 4 pixels long, \fBpbmclean\fP
87 erases that -- turns all four pixels white. \fBpbmclean\fP also erases
88 4 pixels in a square or L-shape.
89 .PP
90 The default \fB-minneighbors\fP is 4, so a blob must have at least 5
91 pixels to escape \fBpbmclean\fP's purge.
92 .PP
93 Extended mode was new in Netpbm 10.56 (September 2011).
94
95
96 .UN options
97 .SH OPTIONS
98 .PP
99 In addition to the options common to all programs based on libnetpbm
100 (most notably \fB-quiet\fP, see
101 .UR index.html#commonoptions
102 Common Options
103 .UE
104 \&), \fBpbmclean\fP recognizes the following
105 command line options:
106
107
108 .TP
109 \fB-black\fP
110
111 .TP
112 \fB-white\fP
113 Flip pixels of the specified color. By default, if you specify
114 neither \fB-black\fP nor \fB-white\fP, \fBpbmclean\fP flips both
115 black and white pixels which do not have sufficient identical
116 neighbors. If you specify \fB-black\fP, \fBpbmclean\fP leaves the
117 white pixels alone and just erases isolated black pixels. Vice versa
118 for \fB-white\fP. You may specify both \fB-black\fP and
119 \fB-white\fP to get the same as the default behavior.
120
121 .TP
122 \fB-minneighbors=\fP\fIN\fP
123 This determines how many pixels must be in a cluster in order
124 for \fBpbmclean\fP to consider them legitimate and not clean them
125 out of the image. See
126 .UR #description
127 Description
128 .UE
129 \&.
130 .sp
131 Before December 2001, \fBpbmclean\fP accepted \fB-\fP\fIN\fP
132 instead of \fB-minneighbors\fP. Before Netpbm 10.27 (March 2005),
133 \fB-minneighbors\fP was \fB-minneighbor\fP.
134
135 .TP
136 \fB-extended\fP
137 \fBpbmclean\fP uses extended, as opposed to basic, isolated pixel
138 detection.
139 .sp
140 This option was new in Netpbm 10.56 (September 2011).
141
142
143
144 .UN seealso
145 .SH SEE ALSO
146 .BR "pbm" (1)\c
147 \&
148
149 .UN author
150 .SH AUTHOR
151
152 Copyright (C) 1990 by Angus Duggan
153 Copyright (C) 1989 by Jef Poskanzer.
154 Copyright (C) 2001 by Michael Sternberg.
155 .PP
156 Permission to use, copy, modify, and distribute this software and its
157 documentation for any purpose and without fee is hereby granted, provided
158 that the above copyright notice appear in all copies and that both that
159 copyright notice and this permission notice appear in supporting
160 documentation. This software is provided "as is" without express or
161 implied warranty.
162 .SH DOCUMENT SOURCE
163 This manual page was generated by the Netpbm tool 'makeman' from HTML
164 source. The master documentation is at
165 .IP
166 .B http://netpbm.sourceforge.net/doc/pbmclean.html
167 .PP