summary refs log tree commit diff
path: root/rawtoppm.html
blob: 88add5fcb05c7bfbf5fa8a0c01c37e4ac05fb86e (plain) (blame)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Rawtoppm User Manual</title></head>
<body>
<h1>rawtoppm</h1>
Updated: 06 February 1991
<br>
<a href="#index">Table Of Contents</a>
<h2>NAME</h2>

rawtoppm - convert a stream of raw RGB bytes to a PPM image

<h2 id="synopsis">SYNOPSIS</h2>

<b>rawtoppm</b>

[<b>-headerskip</b> <i>N</i>]

[<b>-rowskip</b> <i>N</i>]

[
<b>-rgb</b>|<b>-rbg</b>|<b>-grb</b>
|<b>-gbr</b>|<b>-brg</b>|<b>-bgr</b>
]

[<b>-interpixel</b>|<b>-interrow</b>] <i>width</i> <i>height</i>

[<i>imagedata</i>]

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>rawtoppm</b> reads raw RGB bytes as input and produces a PPM
image as output.  The input file is just RGB bytes.  You have to
specify the width and height on the command line, since the program
obviously can't get them from the file.  <b>rawtoppm</b> assumes the
maxval of the input samples is 255, and makes the maxval of the output
PPM 255.  

<p><b>rawtoppm</b> assumes the pixels come top first in the input stream.
If they are actually bottom first, the resulting PPM is upside down, so
run it through <b>pamflip -tb</b>.

<h2 id="options">OPTIONS</h2>

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>rawtoppm</b> recognizes the following
command line options:

<dl compact>
<dt><b>-headerskip</b>

<dd>Skip over this many bytes at the beginning of the input stream.
Use this option when the input has some kind of header followed by
a raster suitable for <b>rawtoppm</b>.

<dt><b>-rowskip</b>

<dd>Skip this many bytes at the end of each row of the raster.  (Some
input streams have padding at the end of rows).

<dt><b>-rgb -rbg -grb -gbr -brg -bgr</b>

<dd>This option specifies the order of the color components for each
pixel.  The default is <b>-rgb</b>.

<dt><b>-interpixel -interrow</b>

<dd>These options specify how the colors are interleaved.  The default
is <b>-interpixel</b>, meaning interleaved by pixel.  A byte of red, a
byte of green, and a byte of blue, or whatever color order you
specified.  <b>-interrow</b> means interleaved by row - a row of red,
a row of green, a row of blue, assuming standard rgb color order.  An
<b>-interplane</b> option - all the red pixels, then all the green,
then all the blue - would be an obvious extension, but is not
implemented.  You could get the same effect by splitting the file into
three parts (perhaps using <b>dd</b>), turning each part into a PGM
file with <b>rawtopgm</b>, and then combining them with <b>rgb3toppm</b>.

</dl>

<h2 id="seealso">SEE ALSO</h2>

<a href="ppm.html">ppm</a>, 
<a href="rawtopgm.html">rawtopgm</a>, 
<a href="rgb3toppm.html">rgb3toppm</a>, 
<a href="pamflip.html">pamflip</a>

<h2 id="author">AUTHOR</h2>

Copyright (C) 1991 by Jef Poskanzer.

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#author">AUTHOR</a>
</ul>
</body>
</html>