Debian Codegraph @

upstream/debian-unstable/man1/rawtopgm.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 "Rawtopgm User Manual" 1 "14 September 2000" "netpbm documentation"
7
8 .SH NAME
9
10 rawtopgm - convert raw grayscale bytes to a PGM image
11
12 .UN synopsis
13 .SH SYNOPSIS
14
15 \fBrawtopgm\fP
16
17 [\fB-bpp\fP [\fB1\fP|\fB2\fP]]
18
19 [\fB-littleendian\fP]
20
21 [\fB-maxval\fP \fIN\fP]
22
23 [\fB-headerskip\fP \fIN\fP]
24
25 [\fB-rowskip\fP \fIN\fP]
26
27 [\fB-tb\fP|\fB-topbottom\fP]
28
29 [\fIwidth\fP \fIheight\fP]
30
31 [\fIimagefile\fP]
32
33 .UN description
34 .SH DESCRIPTION
35 .PP
36 This program is part of
37 .BR "Netpbm" (1)\c
38 \&.
39 .PP
40 \fBrawtopgm\fP reads raw grayscale values as input and produces a
41 PGM image as output. The input file is just a sequence of pure binary
42 numbers, either one or two bytes each, either bigendian or
43 littleendian, representing gray values. They may be arranged either
44 top to bottom, left to right or bottom to top, left to right. There
45 may be arbitrary header information at the start of the file (to which
46 \fBrawtopgm\fP pays no attention at all other than the header's
47 size).
48 .PP
49 Arguments to \fBrawtopgm\fP tell how to interpret the pixels (a
50 function that is served by a header in a regular graphics format).
51 .PP
52 The \fIwidth\fP and \fIheight\fP parameters tell the dimensions
53 of the image. If you omit these parameters, \fBrawtopgm\fP assumes
54 it is a quadratic image and bases the dimensions on the size of the
55 input stream. If this size is not a perfect square, \fBrawtopgm\fP
56 fails.
57 .PP
58 When you don't specify \fIwidth\fP and \fIheight\fP,
59 \fBrawtopgm\fP reads the entire input stream into storage at once,
60 which may take a lot of storage. Otherwise, \fBrawtopgm\fP
61 ordinarily stores only one row at a time.
62 .PP
63 If you don't specify \fIimagefile\fP, or specify \fB-\fP, the
64 input is from Standard Input.
65 .PP
66 The PGM output is to Standard Output.
67
68 .UN options
69 .SH OPTIONS
70 .PP
71 In addition to the options common to all programs based on libnetpbm
72 (most notably \fB-quiet\fP, see
73 .UR index.html#commonoptions
74 Common Options
75 .UE
76 \&), \fBrawtopgm\fP recognizes the following
77 command line options:
78
79
80 .TP
81 \fB-maxval\fP \fIN\fP
82 \fIN\fP is the maxval for the gray values in the input, and is
83 also the maxval of the PGM output image. The default is the maximum
84 value that can be represented in the number of bytes used for each
85 sample (i.e. 255 or 65535).
86
87 .TP
88 \fB-bpp\fP [\fB1\fP|\fB2\fP]
89 tells the number of bytes that represent each sample in the input.
90 If the value is \fB2\fP, The most significant byte is first in the
91 stream.
92 .sp
93 The default is 1 byte per sample.
94
95 .TP
96 \fB-littleendian\fP
97 says that the bytes of each input sample are ordered with the
98 least significant byte first. Without this option, \fBrawtopgm\fP
99 assumes MSB first. This obviously has no effect when there is only
100 one byte per sample.
101
102 .TP
103 \fB-headerskip\fP \fIN\fP
104 \fBrawtopgm\fP skips over \fIN\fP bytes at the beginning of the
105 stream and reads the image immediately after. The default is 0.
106 .sp
107 This is useful when the input is actually some graphics format that
108 has a descriptive header followed by an ordinary raster, and you don't
109 have a program that understands the header or you want to ignore the
110 header.
111
112 .TP
113 \fB-rowskip\fP \fIN\fP
114 If there is padding at the ends of the rows, you can skip it with
115 this option. Note that rowskip need not be an integer. Amazingly, I
116 once had an image with 0.376 bytes of padding per row. This turned
117 out to be due to a file-transfer problem, but I was still able to read
118 the image.
119 .sp
120 Skipping a fractional byte per row means skipping one byte per
121 multiple rows.
122
123 .TP
124 \fB-bt -bottomfirst\fP
125 By default, \fBrawtopgm\fP assumes the pixels in the input go top
126 to bottom, left to right. If you specify \fB-bt\fP or
127 \fB-bottomfirst\fP, \fBrawtopgm\fP assumes the pixels go bottom to
128 top, left to right. The Molecular Dynamics and Leica confocal format,
129 for example, use the latter arrangement.
130 .sp
131 If you don't specify \fB-bt\fP when you should or vice versa, the
132 resulting image is upside down, which you can correct with
133 \fBpamflip\fP.
134 .sp
135 This option causes \fBrawtopgm\fP to read the entire input stream
136 into storage at once, which may take a lot of storage. Normally,
137 \fBrawtopgm\fP stores only one row at a time.
138 .sp
139 For backwards compatibility, \fBrawtopgm\fP also accepts \fB-tb
140 \fP and \fB-topbottom\fP to mean exactly the same thing. The
141 reasons these are named backwards is that the original author thought
142 of it as specifying that the wrong results of assuming the data is top
143 to bottom should be corrected by flipping the result top for bottom.
144 Today, we think of it as simply specifying the format of the input
145 data so that there are no wrong results.
146
147
148
149 .UN seealso
150 .SH SEE ALSO
151 .BR "pgm" (1)\c
152 \&,
153 .BR "rawtoppm" (1)\c
154 \&,
155 .BR "pamflip" (1)\c
156 \&
157
158 .UN authors
159 .SH AUTHORS
160
161 Copyright (C) 1989 by Jef Poskanzer.
162 Modified June 1993 by Oliver Trepte, \[email protected]\fP
163 .SH DOCUMENT SOURCE
164 This manual page was generated by the Netpbm tool 'makeman' from HTML
165 source. The master documentation is at
166 .IP
167 .B http://netpbm.sourceforge.net/doc/rawtopgm.html
168 .PP