1Pamtooctaveimg User Manual(0) Pamtooctaveimg User Manual(0)
2
3
4
5 " "netpbm documentation"
6
8 pamtooctaveimg - convert a Netpbm image to a GNU Octave image
9
10
12 pamtooctaveimg [netpbmfile]
13
14
16 This program is part of Netpbm(1).
17
18 pamtooctaveimg reads a Netpbm image as input and produces a GNU Octave
19 ⟨http://www.octave.org/⟩ image file as output.
20
21 An Octave image file (called "Octave's image format" in Octave documen‐
22 tation) is a particular kind of Octave data file. It describes two
23 matrices:
24
25
26
27 · the image itself as a list of indexes into a colormap, and
28
29 · the corresponding colormap as a list of {red, green, blue}
30 triplets.
31
32
33 An Octave data file is an ASCII text file that you use to import data
34 to Octave.
35
36 See the
37 Image Processing chapter
38 ⟨http://www.gnu.org/software/octave/doc/interpreter/Image-
39 Processing.html#Image-Processing⟩ of the GNU Octave manual for
40 details.
41
42 pamtooctaveimg writes the output Octave image to Standard Output.
43
44
46 There are no command line options defined specifically for pamtooc‐
47 taveimg, but it recognizes the options common to all programs based on
48 libnetpbm (See
49 Common Options ⟨index.html#commonoptions⟩ .)
50
51
53 netpbmfile is the name of the file containing the input PNM or PAM
54 image, or - to indicate Standard Input. If you don't specify netpbm‐
55 file, the input is from Standard Input. pamtooctaveimg converts only
56 the first image in the input stream.
57
58
60 % pamtooctaveimg myimage.ppm > myimage.img
61 % octave
62 > [img,map] = loadimage("myimage.img");
63
64 # (At this point, img is an X by Y matrix and map is a 3 by M matrix.)
65
66 > imshow(img,map); # Displays img with colormap map
67 > [r,g,b] = ind2rgb(img,map);
68
69 # (r, g, and b are now each X by Y matrices of color levels [0 to 1].)
70
71 > [newimg,newmap] = rgb2ind(r,b,g); # Swap the blue and green channels.
72 > saveimage("newimage.ppm", newimg, "ppm", newmap); # Save as a PPM file.
73
74
76 There is no octavetopam program. However, GNU Octave's saveimage com‐
77 mand can save images in PPM format.
78
79
80
82 pamtooctaveimg was new in Netpbm 10.39 (June 2007).
83
84
86 Copyright (C) 2007 Scott Pakin, scott+pbm@pakin.org.
87
88
90 octave(1), pam(1).
91
93 This manual page was generated by the Netpbm tool 'makeman' from HTML
94 source. The master documentation is at
95
96 http://netpbm.sourceforge.net/doc/pamtooctaveimg.html
97
98 27 June 2007 Pamtooctaveimg User Manual(0)