# pamtooctaveimg - convert a Netpbm image to a GNU Octave image - man(1) - [phpMan]


*Source: tldr-pages*

---

_Pamtooctaveimg_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)          General Commands Manual         _Pamtooctaveimg_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)

## NAME
       pamtooctaveimg - convert a Netpbm image to a GNU Octave image


## SYNOPSIS
       **pamtooctaveimg **[_netpbmfile_]


## DESCRIPTION
       This program is part of [**Netpbm**(1)](https://www.chedong.com/phpMan.php/man/Netpbm/1/markdown).

       **pamtooctaveimg **reads a Netpbm image as input and produces a [GNU Octave](<http://www.octave.org/>)  image file as output.

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



       •      the image itself as a list of indexes into a colormap, and

       •      the corresponding colormap as a list of {red, green, blue} triplets.


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

       See the [ Image Processing chapter](<http://www.gnu.org/software/octave/doc/interpreter/Image-Processing.html#Image-Processing>)  of the GNU Octave manual for details.

       **pamtooctaveimg **writes the output Octave image to Standard Output.


## OPTIONS
       There  are no command line options defined specifically for **pamtooctaveimg**, but it recognizes
       the options common to all programs based on libnetpbm (See [ Common Options](index.html#commonoptions) .)


## ARGUMENTS
       _netpbmfile_ is the name of the file containing the input PNM or PAM image, or  **-  **to  indicate
       Standard Input.  If you don't specify _netpbmfile_, the input is from Standard Input.  **pamtooc‐**
       **taveimg **converts only the first image in the input stream.


## EXAMPLES
          % 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.



## NOTES
       There  is no **octavetopam **program.  However, GNU Octave's **saveimage **command can save images in
       PPM format.


## HISTORY
       **pamtooctaveimg **was new in Netpbm 10.39 (June 2007).


## AUTHOR
       Copyright (C) 2007 Scott Pakin, _scott+<pbm@pakin.org_>.


## SEE ALSO
       [**octave**(1)](https://www.chedong.com/phpMan.php/man/octave/1/markdown), [**pam**(1)](https://www.chedong.com/phpMan.php/man/pam/1/markdown).

## DOCUMENT SOURCE
       This manual page was generated by the Netpbm tool 'makeman' from  HTML  source.   The  master
       documentation is at

              **<http://netpbm.sourceforge.net/doc/pamtooctaveimg.html>**

netpbm documentation                        27 June 2007               _Pamtooctaveimg_ _User_ [_Manual_(1)](https://www.chedong.com/phpMan.php/man/Manual/1/markdown)
