pbm2viff(1)

PROGRAM
pbm2viff - Converts a PBM image into a VIFF image.

SYNTAX

pbm2viff

-i  input PBM file defintion

-o  output resulting viff image

[-V]
    Gives the version for pbm2viff

[-U]
    Gives the usage for pbm2viff

[-P]
    Prompts for command line options

[-A [file1]]
    Creates the answer file called pbm2viff.ans or file1

[-a [file1]]
    Uses pbm2viff.ans or file1 as the answer file

DESCRIPTION
pbm2viff converts a PBM image to a VIFF image. One of six possible PBM format images is converted to an appropriate VIFF image. The number of bands, data storage type, and map scheme of the resulting VIFF image is dependent upon the data storage type and class of the input PBM image.

There are three basic categories of PBM file formats with two types in each category. The three categories of PBM file formats are "pbm", "pgm", and "ppm". Within each category it is possible to have the data as either "ascii" or "raw", thus there are a total of six types of PBM file formats.

The three categories of PBM file formats are explained as follows:

  pbm - portable bitmap file format
        This file format is used as the lowest common
        deonominator monochrome file format.
        The header contains the following information:
                             ascii          raw
                             -----         -----
        Magic Number -         P1     or     P4
        Whitespace   -    (blanks, TABs, CRs, LFs)
        Width        -  formatted as ASCII characters in decimal.
        Whitespace   -
        Height       -  formatted as ASCII characters in decimal.
        Whitespace   -
        Data:
         ASCII (P1)  -  characters '1' (black) or '0' (white)
                        starting in top left corner and proceeding
                        from left to right.  No line should exceed
                        70 characters.  Whitespace in this section
                        is ignored.
         RAW (P4)    -  the bits are stored eight per byte, high
                        bit first and low bit last.  No whitespace
                        is allowed in this section.  These files
                        are eight times smaller than the ASCII (P1)
                        files.
        Comments     -  begin with a '#' to the next end-of-line.
                        May be placed anywhere in the header.
  pgm - portable graymap file format
        This file format is used as the lowest common
        deonominator grayscale file format.
        The header contains the following information:
                             ascii          raw
                             -----         -----
        Magic Number -         P2     or     P5
        Whitespace   -    (blanks, TABs, CRs, LFs)
        Width        -  formatted as ASCII characters in decimal.
        Whitespace   -
        Height       -  formatted as ASCII characters in decimal.
        Whitespace   -
        Max Value    -  formatted as ASCII characters in decimal.
        Whitespace   -
        Data:
         ASCII (P2)  -  characters specifying the gray value in
                        ASCII decimal.  These values may range
                        anywhere from 0 to the maximum gray value.
                        Each character is separated by whitespace,
                        and starts at the top left corner of the
                        graymap.  A value of 0 means black, and
                        the maximum value means white.  No line
                        should be longer than 70 characters.
         RAW (P5)    -  The gray values are stored as plain bytes
                        instead of ASCII decimal.  No whitespace
                        is allowed in this section.  Note that
                        values in this section are limited to
                        maxvalues less than or equal to 255.
        Comments     -  begin with a '#' to the next end-of-line.
                        May be placed anywhere in the header.
  ppm - portable pixmap file format
        This file format is used as the lowest common
        deonominator color image file format.
        The header contains the following information:
                             ascii          raw
                             -----         -----
        Magic Number -         P3     or     P6
        Whitespace   -    (blanks, TABs, CRs, LFs)
        Width        -  formatted as ASCII characters in decimal.
        Whitespace   -
        Height       -  formatted as ASCII characters in decimal.
        Whitespace   -
        Max Value    -  formatted as ASCII characters in decimal.
        Whitespace   -
        Data:
         ASCII (P3)  -  characters specifying the maximum color-
                        component value, in ASCII decimal.  Three
                        values are required to represent each pixel.
                        One value for each component of "r" "g" "b".
                        Each character is separated by whitespace,
                        and starts at the top left corner of the
                        pixmap.  The three values for each pixel
                        represent red, green, and blue respectively.
                        A value of 0 means that the color is turned
                        off and the maxvalue represents the maximum
                        intensity for that color. No line should be
                        longer than 70 characters.
         RAW (P6)    -  The gray values are stored as plain bytes
                        instead of ASCII decimal.  No whitespace
                        is allowed in this section.  Note that
                        values in this section are limited to
                        maxvalues less than or equal to 255.
        Comments     -  begin with a '#' to the next end-of-line.
                        May be placed anywhere in the header.

The PBM file formats described above were created by Jef Poskanzer,
Copyright (C) 1989.

The resulting VIFF image will of data storage type, BIT, BYTE, SHORT, and INTEGER.
The map sheme will be none, since a multiband color image will be
stored as three bands in the VIFF image.  Therefore the VIFF image
will be either a 1-band image or a 3-band image with no color map.  The
resulting VIFF image will be stored as data type BIT if the input image was
a pbm image.  A 1-band VIFF image of type INTEGER will result if the input image
is of type pgm stored as ASCII data.  If the pgm image was stored as raw
data, then the resulting VIFF will be stored as a 1-band BYTE image.
A ppm image stored as ASCII data will result in a 3-band INTEGER image,
whereas a ppm image stored as raw data will result in a 3-band BYTE image.

Since the PBM file format does not contain any color map information,
the resulting output VIFF image will not contain a color map.

The valid input files must be one of the PBM file format types discussed
above.

REQUIRED ARGUMENTS

-i  type: infile
    desc: input PBM file defintion

-o  type: outfile
    desc: output resulting viff image

OPTIONAL ARGUMENTS
none

EXAMPLES
pbm2viff -i image.pbm -o image.xv

the pbm image "image.pbm" will be converted to the VIFF image, "image.xv".

SEE ALSO
intro(1), verror(3), vgparms(3), vutils(3), lpbm2viff(3) viff2pbm(1)

RESTRICTIONS
will only accept an image conforming to one of the PBM images.

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.