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