summary refs log tree commit diff
path: root/pamtooctaveimg.html
blob: 43f05847b6475aa3f3e5881a4d46861b46667481 (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
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pamtooctaveimg User Manual</title></head>
<body>
<h1>pamtooctaveimg</h1>
<br>
<p>Updated: 27 June 2007
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

<p>pamtooctaveimg - convert a Netpbm image to a GNU Octave image

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

<p><b>pamtooctaveimg</b>
[<i>netpbmfile</i>]

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

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

<p><b>pamtooctaveimg</b> reads a Netpbm image as input and produces a <a
href="http://www.octave.org/">GNU Octave</a> image file as output.

<p>An Octave image file (called "Octave's image format" in
Octave documentation) is a particular kind of Octave data file.  It
describes two matrices:

<ol>
<li>the image itself as a list of indexes into a colormap, and</li>
<li>the corresponding colormap as a list of {red, green, blue} triplets.</li>
</ol>

<p>An Octave data file is an ASCII text file that you use to import data
to Octave.

<p>See the <a
href="http://www.gnu.org/software/octave/doc/interpreter/Image-Processing.html#Image-Processing">
Image Processing chapter</a> of the GNU Octave manual for details.

<p><b>pamtooctaveimg</b> writes the output Octave image to Standard Output.

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

<p>There are no command line options defined specifically
for <b>pamtooctaveimg</b>, but it recognizes the options common to all
programs based on libnetpbm (See <a href="index.html#commonoptions">
Common Options</a>.)

<h2 id="arguments">ARGUMENTS</h2>

<p><i>netpbmfile</i> is the name of the file containing the input PNM
or PAM image, or <b>-</b> to indicate Standard Input.  If you don't
specify <i>netpbmfile</i>, the input is from Standard Input.
<b>pamtooctaveimg</b> converts only the first image in the input stream.

<h2 id="examples">EXAMPLES</h2>

<pre>
<kbd>
   % pamtooctaveimg myimage.ppm &gt; myimage.img
   % octave
   &gt; [img,map] = loadimage("myimage.img");

   # (At this point, img is an X by Y matrix and map is a 3 by M matrix.)

   &gt; imshow(img,map);   # Displays img with colormap map
   &gt; [r,g,b] = ind2rgb(img,map);

   # (r, g, and b are now each X by Y matrices of color levels [0 to 1].)

   &gt; [newimg,newmap] = rgb2ind(r,b,g);   # Swap the blue and green channels.
   &gt; saveimage("newimage.ppm", newimg, "ppm", newmap);  # Save as a PPM file.
</kbd>
</pre>

<h2 id="notes">NOTES</h2>

<p>There is no <b>octavetopam</b> program.  However, GNU Octave's
<b>saveimage</b> command can save images in PPM format.

<h2 id="history">HISTORY</h2>

<p><b>pamtooctaveimg</b> was new in Netpbm 10.39 (June 2007).

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

<p>Copyright (C) 2007 Scott Pakin,
<a href="mailto:scott+pbm@pakin.org">scott+pbm@pakin.org</a>.

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

<a
href="http://www.gnu.org/software/octave/doc/interpreter/index.html"><b>octave</b></a>,
<a href="pam.html"><b>pam</b></a>.

<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="#arguments">ARGUMENTS</a>
<li><a href="#examples">EXAMPLES</a>
<li><a href="#notes">NOTES</a>
<li><a href="#history">HISTORY</a>
<li><a href="#author">AUTHOR</a>
<li><a href="#seealso">SEE ALSO</a>
</ul>
</body>
</html>