summaryrefslogtreecommitdiff
path: root/static/v10/man1/bcp.1
blob: ab7cf5416a4b11b963971ddd46249e1b66bef798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
.TH BCP 1 
.CT 1 graphics
.SH NAME
bcp \(mi reformat black-and-white picture files
.SH SYNOPSIS
.B bcp
[
.I option ...
]
[
.I file1
[
.I file2
]
]
.SH DESCRIPTION
.I Bcp
copies black-and-white (B&W) image
.I file1
to
.I file2,
optionally changing the file format and transforming the image.
If
.I file1
is a directory name,
then every leaf of its file tree is processed in turn; and, in this case,
if
.I file2
also is specified, it is made the root directory
of an isomorphic tree of output files.
If
.I file2
is not specified, all output is catenated to stdout.
.PP
.I Bcp
can copy among all the B&W
.IR picfile (5)
formats, and some others.
The default output format is 
.BR TYPE=ccitt-g4 .
Image transformations include trimming, translation, scaling, and rotation,
performed in that order (not in argument order).
.PP
Input files in
.IR picfile (5)
format must begin with an ASCII 
.BI TYPE= type
header line.
.I Types
supported both as input and output are:
.nr xx \w'\fLccitt-g4\ '
.TP \n(xxu
.B dump
One byte/pixel.
.B NCHAN=1
is required.
On input, the grey pixel values are thresholded
to B&W;
see option
.BR -T .
On output, black becomes 0 and white 255.
.TP
.B bitmap
One bit/pixel.
Essentially Sun rasterfile format, with a
.IR picfile (5)
header replacing the Sun binary header.
.TP
.B ccitt-g4
CCITT Group 4 FAX encoding, strongly compressive on printed text.
Also,
.B ccitt-g31
(Group 3, 1-dim)
and
.B ccitt-g32
(Group 3, 2-dim; see
.BR -k ).
.LP
Other supported
.I types
are:
.TP \n(xxu
.B binary
One bit/pixel encoding; obsolescent, but needed for old image archives.
Both input and output.
.TP
.B rle
Fast run-length encoding; obsolescent, but needed for old image archives.
Input or output, but not both.
.TP
.B pico
Same as
.BR dump .
Input only.
.TP
.B cdf
`Compound document format', used in AT&T FAX Connection product.
Input only.
Only the first of multiple pages is read.
.LP
Other formats not using a 
.BI TYPE= type
header, are:
.IR bitfile (9.5)
format;
PostScript bitmap format (output only); and
Sun rasterfile format (with the Sun binary header; output only).
.PP
The options are:
.TP \n(xxu
.B -B[io]
Read/write
.IR bitfile (9.5)
format (no 
.BI TYPE= type
header).
.TP
.B -M
Write 
.B TYPE=bitmap
format.
.TP
.B -P
Write Postscript bitmap format (Suns only).
.TP
.BI -R x , y
Force output resolutions to 
.I x,y
(pixels/inch).
If 
.BI , y
is missing, it is taken to be the same as
.I x.
Overrides
.BI -x x , y .
Requires a 
.BI RES= "x y
line in the header (but, see 
.BR -Z ).
.TP
.B -R=
Force the output resolution to be equal to the greater of
the input resolutions.
.TP
.B -S
Write Sun rasterfile format (no 
.BI TYPE= type
header; on Suns only).
.TP
.BI -T t
Threshold.
When reading 
.BR TYPE=dump ,
assign black to grey levels less than
.I t,
and white to others.
Default:
.BR -T128 .
.TP
.BI -Z x , y
Force input 
.BI RES= "x y.
.TP
.B -b
Write 
.B TYPE=binary
format.
.TP
.B -g4
.br
.ns
.TP
.B -4
Write 
.B TYPE=ccitt-g4
format.
Similarly, 
.B -g31
or
.B -31
and 
.B -g32
or
.BR -32 .
.TP
.BI -k n
Set the `k' for 
.B ccitt-g32
encoding on output (default
.BR -k4 ).
.TP
.BI -o x , y
Offset (translate) the image by 
.I x,y
pixels.
The width and height of the picture are not changed.
.TP
.B -p
Write 
.B TYPE=dump NCHAN=1
format.
Map black to 0, white to 255.
.TP
.B -r
Write 
.B TYPE=rle
format.
.TP
.B -tl
Rotate the image to bring the left edge of the page to the top.
Set top-left corner of the rotated
image at the top-left corner of the image.
.TP
.BI -t d
Rotate the image 
.I d
degrees counterclockwise about its center.
.I d
is a real number.
.TP
.BI -w l,t,r,b
Specify window (trim the image):
.I l,t
is the left-top corner and 
.I r,b
the right-bottom corner measured in pixels.
If the new margins are outside the original picture,
the new area is set to white.
An argument given as
.L %
leaves the edge unchanged.
.TP
.BI -x x , y
Expand/contract (scale) the image, by real factors 
.I x
and
.I y.
If
.BI , y
is missing,
.I y
is taken to be the same as
.I x.
May be overridden by 
.BI -R x , y.
Requires a 
.BI RES= "x y
line in the header (but, see 
.BR -Z ).
.SH SEE ALSO
.IR cscan (1),
.IR imscan (1),
.IR ocr (1),
.IR pico (1),
.IR picfile (5)
.br
CCITT facsimile coding standards Rec. T.4(1988) and T.6(1988).
.SH BUGS
Concatenated pages are supported, but only if each new page has a complete
header.
.br
Scaling is accomplished by naive replication/deletion of pixels.
.br
Rotation by small angles exhibits aliasing effects, and is slow.
.br
Rotations
.B -tr
and
.B -tb
are unfinished.
.br
CCITT FAX `uncompressed' (or, `transparent') mode is not implemented.
.br
Postscript output is useful only for small images.
.br
.BI WINDOW= "l t r b
where
.I l
or
.I t
is non-zero
may not be handled correctly for every combination of file types.
.br
.B TYPE=rle
can't be both input and output.
.br
Should be merged with T. Duff's
.I pcp.