Delila Program: pnmnormalize

pnmnormalize program

Documentation for the pnmnormalize program is below, with links to related programs in the "see also" section.

{   version = 1.09; (* of pnmnormalize.p 2016 Jan 29}

(* begin module describe.pnmnormalize *)
   pnmnormalize: normalize a pnm file to a given size

   pnmnormalize(input: in, pnmnormalizep: in, output: out)

   input:  a pnm file

   output:  the pnm file resized according to the parameters

   pnmnormalizep:  parameters to control the program
      version: lowest version number acceptable
      startwidth, startheight: the width and height to start writing out
      endwidth, endheight: the width and height to end writing out

   output: messages to the user

   The program allows one to regularize a set of pnm for making a movie
   with gifmerge.  It reads in a pnm format file created by:

   giftopnm < $1 > $1.pnm

   and writes it out again.  The rectangular region that is written
   out is given by the two points
      (startwidth, startheight)
      (endwidth, endheight)

   Note that the final size will be
      endwidth - startwidth + 1
      endheight - startheight + 1

  The resulting pnm file can then be converted backto a gif using pnmgif.



   Manual page from ppm:

ppm(5)             Headers, Tables, and Macros             ppm(5)

     ppm - portable pixmap file format

     The portable pixmap format is a  lowest  common  denominator
     color image file format.  The definition is as follows:

     - A "magic number" for identifying the  file  type.   A  ppm
       file's magic number is the two characters "P3".

     - Whitespace (blanks, TABs, CRs, LFs).

     - A width, formatted as ASCII characters in decimal.

     - Whitespace.

     - A height, again in ASCII decimal.

     - Whitespace.

     - The maximum color-component value, again in ASCII decimal.

     - Whitespace.

     - Width * height pixels, each  three  ASCII  decimal  values
       between 0 and the specified maximum value, starting at the
       top-left  corner  of  the  pixmap,  proceeding  in  normal
       English  reading  order.   The three values for each pixel
       represent red, green, and blue, respectively; a value of 0
       means  that color is off, and the maximum value means that
       color is maxxed out.

     - Characters from a "#" to the next end-of-line are  ignored

     - No line should be longer than 70 characters.

     Here is an example of a small pixmap in this format:
     # feep.ppm
     4 4
      0  0  0    0  0  0    0  0  0   15  0 15
      0  0  0    0 15  7    0  0  0    0  0  0
      0  0  0    0  0  0    0 15  7    0  0  0
     15  0 15    0  0  0    0  0  0    0  0  0

     Programs that read this format should be as lenient as  pos-
     sible, accepting anything that looks remotely like a pixmap.

     There is also a variant on the format, available by  setting
     the  RAWBITS  option  at  compile  time.   This  variant  is
     different in the following ways:

     - The "magic number" is "P6" instead of "P3".

     - The pixel values are stored as  plain  bytes,  instead  of
       ASCII decimal.

     - Whitespace is not allowed in the pixels area, and  only  a
       single  character  of  whitespace (typically a newline) is
       allowed after the maxval.

     - The files are smaller and many times faster  to  read  and

     Note that this raw format can only be used for maxvals  less
     than or equal to 255.  If you use the ppm library and try to
     write a file with a larger  maxval,  it  will  automatically
     fall back on the slower but more general plain format.



   This program was formerly called gifnormalize, but that is not
   correct since it only works with the pnm format.

   man ppm

see also

   example parameter file: pnmnormalizep

   script that uses this program gifconvert: gifconvert


   Thomas Dana Schneider


technical notes

   Two constants, maxwidth and maxheight determine the largest allowed image
   that can be processed.  A message will be output if either of these are

(* end module describe.pnmnormalize *)
{This manual page was created by makman 1.45}

{created by htmlink 1.62}