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
115
116
117
118
119
120
121
122
|
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it! If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Pamtooctaveimg User Manual" 0 "27 June 2007" "netpbm documentation"
.PP
.SH NAME
.PP
pamtooctaveimg - convert a Netpbm image to a GNU Octave image
.UN synopsis
.SH SYNOPSIS
.PP
\fBpamtooctaveimg\fP
[\fInetpbmfile\fP]
.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBpamtooctaveimg\fP reads a Netpbm image as input and produces a
.UR http://www.octave.org/
GNU Octave
.UE
\& image file as output.
.PP
An Octave image file (called "Octave's image format" in
Octave documentation) is a particular kind of Octave data file. It
describes two matrices:
.IP \(bu
the image itself as a list of indexes into a colormap, and
.IP \(bu
the corresponding colormap as a list of {red, green, blue} triplets.
.PP
An Octave data file is an ASCII text file that you use to import data
to Octave.
.PP
See the
.UR http://www.gnu.org/software/octave/doc/interpreter/Image-Processing.html#Image-Processing
Image Processing chapter
.UE
\& of the GNU Octave manual for details.
.PP
\fBpamtooctaveimg\fP writes the output Octave image to Standard Output.
.UN options
.SH OPTIONS
.PP
There are no command line options defined specifically
for \fBpamtooctaveimg\fP, but it recognizes the options common to all
programs based on libnetpbm (See
.UR index.html#commonoptions
Common Options
.UE
\&.)
.UN arguments
.SH ARGUMENTS
.PP
\fInetpbmfile\fP is the name of the file containing the input PNM
or PAM image, or \fB-\fP to indicate Standard Input. If you don't
specify \fInetpbmfile\fP, the input is from Standard Input.
\fBpamtooctaveimg\fP converts only the first image in the input stream.
.UN examples
.SH EXAMPLES
.nf
\f(CW
% pamtooctaveimg myimage.ppm > myimage.img
% octave
> [img,map] = loadimage("myimage.img");
# (At this point, img is an X by Y matrix and map is a 3 by M matrix.)
> imshow(img,map); # Displays img with colormap map
> [r,g,b] = ind2rgb(img,map);
# (r, g, and b are now each X by Y matrices of color levels [0 to 1].)
> [newimg,newmap] = rgb2ind(r,b,g); # Swap the blue and green channels.
> saveimage("newimage.ppm", newimg, "ppm", newmap); # Save as a PPM file.
\fP
.fi
.UN notes
.SH NOTES
.PP
There is no \fBoctavetopam\fP program. However, GNU Octave's
\fBsaveimage\fP command can save images in PPM format.
.UN history
.SH HISTORY
.PP
\fBpamtooctaveimg\fP was new in Netpbm 10.39 (June 2007).
.UN author
.SH AUTHOR
.PP
Copyright (C) 2007 Scott Pakin,
\fIscott+pbm@pakin.org\fP.
.UN seealso
.SH SEE ALSO
.BR "\fBoctave\fP" (1)\c
\&,
.BR "\fBpam\fP" (5)\c
\&.
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source. The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/pamtooctaveimg.html
.PP
|