Manual Page Result
0
Command: bcp | Section: 1 | Source: UNIX v10 | File: bcp.1
BCP(1) General Commands Manual BCP(1)
NAME
bcp - reformat black-and-white picture files
SYNOPSIS
bcp [ option ... ] [ file1 [ file2 ] ]
DESCRIPTION
Bcp copies black-and-white (B&W) image file1 to file2, optionally
changing the file format and transforming the image. If file1 is a di-
rectory name, then every leaf of its file tree is processed in turn;
and, in this case, if file2 also is specified, it is made the root di-
rectory of an isomorphic tree of output files. If file2 is not speci-
fied, all output is catenated to stdout.
Bcp can copy among all the B&W picfile(5) formats, and some others.
The default output format is TYPE=ccitt-g4. Image transformations in-
clude trimming, translation, scaling, and rotation, performed in that
order (not in argument order).
Input files in picfile(5) format must begin with an ASCII TYPE=type
header line. Types supported both as input and output are:
dump One byte/pixel. NCHAN=1 is required. On input, the grey
pixel values are thresholded to B&W; see option -T. On out-
put, black becomes 0 and white 255.
bitmap One bit/pixel. Essentially Sun rasterfile format, with a pic-
file(5) header replacing the Sun binary header.
ccitt-g4 CCITT Group 4 FAX encoding, strongly compressive on printed
text. Also, ccitt-g31 (Group 3, 1-dim) and ccitt-g32 (Group
3, 2-dim; see -k).
Other supported types are:
binary One bit/pixel encoding; obsolescent, but needed for old image
archives. Both input and output.
rle Fast run-length encoding; obsolescent, but needed for old im-
age archives. Input or output, but not both.
pico Same as dump. Input only.
cdf `Compound document format', used in AT&T FAX Connection prod-
uct. Input only. Only the first of multiple pages is read.
Other formats not using a TYPE=type header, are: bitfile(9.5) format;
tiff 5.0 format; PostScript bitmap format (output only); and Sun
rasterfile format. Input tiff files may be encoded using the Group 3
or Group 4 schemes, LZW algorithm, modified Huffman encoding, Apple
PackBits, or uncompressed. Sun rasterfiles may be encoded using no
compression, or the byte-length encoding scheme.
The options are:
-B[io] Read/write bitfile(9.5) format (no TYPE=type header).
-Fc Write tiff format, compression scheme c, where c is g3 or g31
(1-dim Group 3), g32 (2-dim Group 3), g4 (Group 4), L (LZW
compression), P (Apple PackBits), or N (no compression).
-M Write TYPE=bitmap format.
-P Write Postscript format.
-Rx,y Force output resolutions to x,y (pixels/inch). If ,y is miss-
ing, it is taken to be the same as x. Overrides -xx,y. Re-
quires a RES=x y line in the header (but, see -Z).
-R= Force the output resolution to be equal to the greater of the
input resolutions.
-S Write Sun rasterfile format (standard encoding).
-Tt Threshold. When reading TYPE=dump, assign black to grey lev-
els less than t, and white to others. Default: -T128.
-Zx,y Force input RES=x y.
-b Write TYPE=binary format.
-g4
-4 Write TYPE=ccitt-g4 format. Similarly, -g31 or -31 and -g32
or -32.
-kn Set the `k' for ccitt-g32 encoding on output (default -k4).
-ox,y Offset (translate) the image by x,y pixels. The width and
height of the picture are not changed.
-p Write TYPE=dump NCHAN=1 format. Map black to 0, white to 255.
-r Write TYPE=rle format.
-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.
-td Rotate the image d degrees counterclockwise about its center.
d is a real number.
-wl,t,r,b
Specify window (trim the image): l,t is the left-top corner
and 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 leaves the edge unchanged.
-xx,y Expand/contract (scale) the image, by real factors x and y.
If ,y is missing, y is taken to be the same as x. May be
overridden by -Rx,y. Requires a RES=x y line in the header
(but, see -Z).
SEE ALSO
cscan(1), imscan(1), ocr(1), pico(1), picfile(5)
CCITT facsimile coding standards Rec. T.4(1988) and T.6(1988).
BUGS
Concatenated pages are supported, but only if each new page has a com-
plete header.
Scaling is accomplished by naive replication/deletion of pixels.
Rotation by small angles exhibits aliasing effects, and is slow.
Rotations -tr and -tb are unfinished.
CCITT FAX `uncompressed' (or, `transparent') mode is not implemented.
Postscript output is useful only for small images.
WINDOW=l t r b where l or t is non-zero may not be handled correctly
for every combination of file types.
tiff LZW compression may not be working properly (input and output).
TYPE=rle can't be both input and output.
Should be merged with T. Duff's pcp.
BCP(1)