|
|
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: tiff 5.0 format;
107: PostScript bitmap format (output only); and
108: Sun rasterfile format.
109: Input tiff files may be encoded using the Group\ 3 or Group\ 4
110: schemes, LZW algorithm, modified Huffman encoding, Apple PackBits, or
111: uncompressed. Sun rasterfiles may be encoded using no compression,
112: or the byte-length encoding scheme.
113: .PP
114: The options are:
115: .TP \n(xxu
116: .B -B[io]
117: Read/write
118: .IR bitfile (9.5)
119: format (no
120: .BI TYPE= type
121: header).
122: .TP
123: .B -Fc
124: Write tiff format, compression scheme c, where c is g3 or g31 (1-dim
125: Group\ 3), g32 (2-dim Group\ 3), g4 (Group\ 4), L (LZW compression),
126: P (Apple PackBits), or N (no compression).
127: .TP
128: .B -M
129: Write
130: .B TYPE=bitmap
131: format.
132: .TP
133: .B -P
134: Write Postscript format.
135: .TP
136: .BI -R x , y
137: Force output resolutions to
138: .I x,y
139: (pixels/inch).
140: If
141: .BI , y
142: is missing, it is taken to be the same as
143: .I x.
144: Overrides
145: .BI -x x , y .
146: Requires a
147: .BI RES= "x y
148: line in the header (but, see
149: .BR -Z ).
150: .TP
151: .B -R=
152: Force the output resolution to be equal to the greater of
153: the input resolutions.
154: .TP
155: .B -S
156: Write Sun rasterfile format (standard encoding).
157: .TP
158: .BI -T t
159: Threshold.
160: When reading
161: .BR TYPE=dump ,
162: assign black to grey levels less than
163: .I t,
164: and white to others.
165: Default:
166: .BR -T128 .
167: .TP
168: .BI -Z x , y
169: Force input
170: .BI RES= "x y.
171: .TP
172: .B -b
173: Write
174: .B TYPE=binary
175: format.
176: .TP
177: .B -g4
178: .br
179: .ns
180: .TP
181: .B -4
182: Write
183: .B TYPE=ccitt-g4
184: format.
185: Similarly,
186: .B -g31
187: or
188: .B -31
189: and
190: .B -g32
191: or
192: .BR -32 .
193: .TP
194: .BI -k n
195: Set the `k' for
196: .B ccitt-g32
197: encoding on output (default
198: .BR -k4 ).
199: .TP
200: .BI -o x , y
201: Offset (translate) the image by
202: .I x,y
203: pixels.
204: The width and height of the picture are not changed.
205: .TP
206: .B -p
207: Write
208: .B TYPE=dump NCHAN=1
209: format.
210: Map black to 0, white to 255.
211: .TP
212: .B -r
213: Write
214: .B TYPE=rle
215: format.
216: .TP
217: .B -tl
218: Rotate the image to bring the left edge of the page to the top.
219: Set top-left corner of the rotated
220: image at the top-left corner of the image.
221: .TP
222: .BI -t d
223: Rotate the image
224: .I d
225: degrees counterclockwise about its center.
226: .I d
227: is a real number.
228: .TP
229: .BI -w l,t,r,b
230: Specify window (trim the image):
231: .I l,t
232: is the left-top corner and
233: .I r,b
234: the right-bottom corner measured in pixels.
235: If the new margins are outside the original picture,
236: the new area is set to white.
237: An argument given as
238: .L %
239: leaves the edge unchanged.
240: .TP
241: .BI -x x , y
242: Expand/contract (scale) the image, by real factors
243: .I x
244: and
245: .I y.
246: If
247: .BI , y
248: is missing,
249: .I y
250: is taken to be the same as
251: .I x.
252: May be overridden by
253: .BI -R x , y.
254: Requires a
255: .BI RES= "x y
256: line in the header (but, see
257: .BR -Z ).
258: .SH SEE ALSO
259: .IR cscan (1),
260: .IR imscan (1),
261: .IR ocr (1),
262: .IR pico (1),
263: .IR picfile (5)
264: .br
265: CCITT facsimile coding standards Rec. T.4(1988) and T.6(1988).
266: .SH BUGS
267: Concatenated pages are supported, but only if each new page has a complete
268: header.
269: .br
270: Scaling is accomplished by naive replication/deletion of pixels.
271: .br
272: Rotation by small angles exhibits aliasing effects, and is slow.
273: .br
274: Rotations
275: .B -tr
276: and
277: .B -tb
278: are unfinished.
279: .br
280: CCITT FAX `uncompressed' (or, `transparent') mode is not implemented.
281: .br
282: Postscript output is useful only for small images.
283: .br
284: .BI WINDOW= "l t r b
285: where
286: .I l
287: or
288: .I t
289: is non-zero
290: may not be handled correctly for every combination of file types.
291: .br
292: tiff LZW compression may not be working properly (input and output).
293: .br
294: .B TYPE=rle
295: can't be both input and output.
296: .br
297: Should be merged with T. Duff's
298: .I pcp.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.