| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN"> |
| 2 | <html><head><title>Pamtooctaveimg User Manual</title></head> |
| 3 | <body> |
| 4 | <h1>pamtooctaveimg</h1> |
| 5 | <br> |
| 6 | <p>Updated: 27 June 2007 |
| 7 | <br> |
| 8 | <a href="#index">Table Of Contents</a> |
| 9 | |
| 10 | <h2>NAME</h2> |
| 11 | |
| 12 | <p>pamtooctaveimg - convert a Netpbm image to a GNU Octave image |
| 13 | |
| 14 | <h2 id="synopsis">SYNOPSIS</h2> |
| 15 | |
| 16 | <p><b>pamtooctaveimg</b> |
| 17 | [<i>netpbmfile</i>] |
| 18 | |
| 19 | <h2 id="description">DESCRIPTION</h2> |
| 20 | |
| 21 | <p>This program is part of <a href="index.html">Netpbm</a>. |
| 22 | |
| 23 | <p><b>pamtooctaveimg</b> reads a Netpbm image as input and produces a <a |
| 24 | href="http://www.octave.org/">GNU Octave</a> image file as output. |
| 25 | |
| 26 | <p>An Octave image file (called "Octave's image format" in |
| 27 | Octave documentation) is a particular kind of Octave data file. It |
| 28 | describes two matrices: |
| 29 | |
| 30 | <ol> |
| 31 | <li>the image itself as a list of indexes into a colormap, and</li> |
| 32 | <li>the corresponding colormap as a list of {red, green, blue} triplets.</li> |
| 33 | </ol> |
| 34 | |
| 35 | <p>An Octave data file is an ASCII text file that you use to import data |
| 36 | to Octave. |
| 37 | |
| 38 | <p>See the <a |
| 39 | href="http://www.gnu.org/software/octave/doc/interpreter/Image-Processing.html#Image-Processing"> |
| 40 | Image Processing chapter</a> of the GNU Octave manual for details. |
| 41 | |
| 42 | <p><b>pamtooctaveimg</b> writes the output Octave image to Standard Output. |
| 43 | |
| 44 | <h2 id="options">OPTIONS</h2> |
| 45 | |
| 46 | <p>There are no command line options defined specifically |
| 47 | for <b>pamtooctaveimg</b>, but it recognizes the options common to all |
| 48 | programs based on libnetpbm (See <a href="index.html#commonoptions"> |
| 49 | Common Options</a>.) |
| 50 | |
| 51 | <h2 id="arguments">ARGUMENTS</h2> |
| 52 | |
| 53 | <p><i>netpbmfile</i> is the name of the file containing the input PNM |
| 54 | or PAM image, or <b>-</b> to indicate Standard Input. If you don't |
| 55 | specify <i>netpbmfile</i>, the input is from Standard Input. |
| 56 | <b>pamtooctaveimg</b> converts only the first image in the input stream. |
| 57 | |
| 58 | <h2 id="examples">EXAMPLES</h2> |
| 59 | |
| 60 | <pre> |
| 61 | <kbd> |
| 62 | % pamtooctaveimg myimage.ppm > myimage.img |
| 63 | % octave |
| 64 | > [img,map] = loadimage("myimage.img"); |
| 65 | |
| 66 | # (At this point, img is an X by Y matrix and map is a 3 by M matrix.) |
| 67 | |
| 68 | > imshow(img,map); # Displays img with colormap map |
| 69 | > [r,g,b] = ind2rgb(img,map); |
| 70 | |
| 71 | # (r, g, and b are now each X by Y matrices of color levels [0 to 1].) |
| 72 | |
| 73 | > [newimg,newmap] = rgb2ind(r,b,g); # Swap the blue and green channels. |
| 74 | > saveimage("newimage.ppm", newimg, "ppm", newmap); # Save as a PPM file. |
| 75 | </kbd> |
| 76 | </pre> |
| 77 | |
| 78 | <h2 id="notes">NOTES</h2> |
| 79 | |
| 80 | <p>There is no <b>octavetopam</b> program. However, GNU Octave's |
| 81 | <b>saveimage</b> command can save images in PPM format. |
| 82 | |
| 83 | <h2 id="history">HISTORY</h2> |
| 84 | |
| 85 | <p><b>pamtooctaveimg</b> was new in Netpbm 10.39 (June 2007). |
| 86 | |
| 87 | <h2 id="author">AUTHOR</h2> |
| 88 | |
| 89 | <p>Copyright (C) 2007 Scott Pakin, |
| 90 | <a href="mailto:[email protected]">[email protected]</a>. |
| 91 | |
| 92 | <h2 id="seealso">SEE ALSO</h2> |
| 93 | |
| 94 | <a |
| 95 | href="http://www.gnu.org/software/octave/doc/interpreter/index.html"><b>octave</b></a>, |
| 96 | <a href="pam.html"><b>pam</b></a>. |
| 97 | |
| 98 | <hr> |
| 99 | |
| 100 | <h2 id="index">Table Of Contents</h2> |
| 101 | <ul> |
| 102 | <li><a href="#synopsis">SYNOPSIS</a> |
| 103 | <li><a href="#description">DESCRIPTION</a> |
| 104 | <li><a href="#options">OPTIONS</a> |
| 105 | <li><a href="#arguments">ARGUMENTS</a> |
| 106 | <li><a href="#examples">EXAMPLES</a> |
| 107 | <li><a href="#notes">NOTES</a> |
| 108 | <li><a href="#history">HISTORY</a> |
| 109 | <li><a href="#author">AUTHOR</a> |
| 110 | <li><a href="#seealso">SEE ALSO</a> |
| 111 | </ul> |
| 112 | </body> |
| 113 | </html> |
| 114 |