home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / fbm / readme < prev    next >
Text File  |  1990-06-22  |  8KB  |  204 lines

  1. This directory contains Release 1.0 of the Fuzzy Pixmap Manipulation (FBM)
  2. library of programs.  This collection (in combination with Jef Poskanzer's
  3. PBM collection) provides a complete package for manipulating and converting
  4. color and black and whites images, including 24bit RGB, 8bit mapped color,
  5. 8bit grayscale, and 1bit bitmapped images.
  6.  
  7. Compilation
  8.  
  9.     Unpack all files in one directory.  Edit Makefile and put in
  10.     appropriate values for defaults.
  11.  
  12.     If you wish to have the tiff2fbm and fbm2tiff programs, first
  13.         obtain, unpack, and compile libtiff.a, and then modify FBM 's
  14.     Makefile to include this library.  Then type "make tiff".  Note
  15.     that some versions of libtiff are not careful to put file
  16.     tiffcompat.h into the intstall directory.  The tifflib is
  17.     available from UCBVAX.BERKELEY.EDU, file pub/tiff/v2.2.tar.Z.
  18.  
  19.     If you have the Utah Raster Toolkit, the 'fbcat' program can be
  20.     compiled with the -DRLE flag to include support for RLE files.
  21.     Credit for RLE support to Paul Milazzo <milazzo@pearl.bbn.com>.
  22.     Get the Toolkit from CS.UTAH.EDU, file pub/toolkit-2.0.tar.Z.
  23.  
  24.     Get Jef Poskanzer's PBMPLUS source from EXPO.LCS.MIT.EDU, file
  25.     contrib/pbmplus.tar.Z.
  26.  
  27. File Formats
  28.  
  29.     FBM   (-F)    FBM file with 256 byte header (with title & credits)
  30.     Sun   (-S)    Sun rasterfile with 32 byte header
  31.     Tiff  (-T)    Aldus TIFF
  32.     PBM   (-P)    Poskanzer format for 1bit files
  33.     GIF   (-G)    CompuServe GIF format
  34.     RLE   (-R)    Utah RLE format
  35.     IFF   (-I)    Amiga IFF files (except HAM mode files)
  36.     PCX   (-Z)    PC PaintBrush format for IBM
  37.     Face  (-B)    Bennet Yee's 1bit files, used at CMU
  38.  
  39.     All programs (except fbinfo) can read any of the formats, and use
  40.     the magic number to decide the file type.  If the input is not a
  41.     pipe and is compressed using the net standard 'compress' program,
  42.     the file will be uncompressed as it is read.  Note however that 
  43.     the operation to be performed must make sense; that is you cannot
  44.     halftone a color image, quantize a grayscale image, or resize a
  45.     1bit file.
  46.  
  47. Files and Programs:
  48.  
  49.     README        This file
  50.     README.lib    Lists the subroutines in libfbm.a
  51.     Makefile    Make utility configuration file
  52.     fbm.1        General manual entry
  53.     *.1        Individual manual entries
  54.     fbm.h        Defines FBM data structures
  55.  
  56.     clr2gray  Convert color to grayscale
  57.     fbcat      Copy image (used for format conversion)
  58.     fbclean      Flip isolated pixels (clean image)
  59.     fbedge      Compute derivative image (edge detection)
  60.     fbext      Extract region, resize, change aspect ratio
  61.     fbgamma      Gamma correct grayscale or color image for display
  62.     fbhalf      Halftone grayscale image (Blue noise, Floyd-Steinberg, etc)
  63.     fbham      Convert FBM 24bit RGB to Amiga HAM mode
  64.     fbhist      Compute histogram
  65.     fbinfo      Dump image header
  66.     fbm2pod      Convert grayscale image to Diablo graphics (!)
  67.     fbm2tga      Convert image to Targa format
  68.     fbm2tiff  Convert FBM files to 1, 2, 4, 8, or 24 bit TIFF
  69.     fbmask      Set region to gray value
  70.     fbnorm      Normalize image intensity / increase contrast
  71.     fbpalet      Replace an imager's colormap with another, remove duplicates
  72.     fbps      Convert to PostScript
  73.     fbquant      Color quantization (24 bit to 8..256 colors) Mod. Heckbert
  74.     fbrot      Rotate 90, 180, or 270 degrees
  75.     fbsample  Sample a 1bit file to produce an 8bit file
  76.     fbsharp      Sharpen (edge enhancement) by digital Laplacian
  77.     gray2clr  Add a "gray" colormap to a grayscale image
  78.     idiff      (and udiff) convert raw byte stream into byte difference
  79.     pbm2ps      Convert PBM file to PostScript
  80.     pbmtitle  Add a title to a PBM file
  81.     raw2fbm      Convert raw file to FBM format (eg: Amiga Digiview files)
  82.     tga2fbm   Convert Targa file to FBM format
  83.     tiff2fbm  Convert tiff file to FBM format
  84.     uunet2fbm Convert UseNet Facesaver file to FBM format
  85.  
  86. Extensions
  87.  
  88.     Several file extension conventions are used, but none are enforced
  89.  
  90.     .Z        Compressed file, appended to other extensions
  91.  
  92.     .fbm        Standard extension for FBM format files
  93.     .cbm        Sometimes used to mean a 24bit color FBM file
  94.  
  95.     .ip        8bit grayscale Amiga file (with 1.2 aspect ratio)
  96.     .cp        24bit color Amiga file (with 1.2 aspect ratio)
  97.  
  98.     .1bit        Sun 1bit rastefile
  99.     .clr        Sometimes used to mean a 8bit mapped color Sun file
  100.  
  101.     .bm        Bennet Yee's "Face" format (1bit)
  102.     .pbm        Poskanzer 1bit format
  103.     .gif        Compuserve GIF format
  104.     .pcx        ZSoft's PCPaintbrush format
  105.     .tif or .tiff    Aldus's TIFF format (used on NeXT)
  106.  
  107. Example Unix pipelines to view files:
  108.  
  109.     Starting with an 8 bit raw Amiga grayscale file, foo.ip, first
  110.     create an FBM format file with a title and credit, then process
  111.     that file for viewing on a Sun screen by normalizing, rotating,
  112.     resizing, sharpening, and halftoning.
  113.  
  114.     % raw2fbm -d1 -a1.2 -w640 -h400 \
  115.       -t'Random Title' -c'Random Credit' < foo.ip > foo.fbm
  116.  
  117.     % fbinfo foo.fbm
  118.     foo.fbm            "Random Title"
  119.             [ Random Credit ]
  120.             [640x400x8]    8 physbits  1.2 aspect ratio
  121.             row length 640, plane length 256000, colormap length 0
  122.  
  123.  
  124.     % fbnorm < foo.fbm | \            (normalize)
  125.       fbrot | \                (rotate 90 deg clockwise)
  126.       fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  127.       fbhalf -s10 -S > foo.1bit        (sharpen, halftone, write Sun)
  128.  
  129.  
  130.  
  131.     Starting with a 24 bit color Amiga file, bar.cp, first create an
  132.     FBM format file with title and credit, then render that file for
  133.     viewing on a Sun by normalizing, rotating, sharpening, and
  134.     quantizing.
  135.  
  136.     % raw2fbm -d3 -a1.2 -w640 -h400 \
  137.       -t'Random Color Title' -c'Random Color Credit' < bar.cp > bar.cbm
  138.  
  139.     % fbinfo bar.cbm
  140.     bar.cbm            "Random Color Title"
  141.             [ Random Color Credit ]
  142.             [3x640x400x8]    8 physbits  1.2 aspect ratio
  143.             row length 640, plane length 256000, colormap length 0
  144.  
  145.  
  146.     % fbnorm < bar.cbm | \            (normalize)
  147.       fbrot | \                (rotate 90 deg clockwise)
  148.       fbext -a1 -W900 -H768 | \        (resize & make aspect ratio 1)
  149.       fbsharp 3.0 | \            (sharpen it)
  150.       fbquant -S > bar.clr            (quantize and write Sun)
  151.  
  152.     (Note that sharpening is an integral option to the halftoning
  153.      program using the -s option, but that color images must currently
  154.      be sharpened using a separate program.  Note also that more
  155.      sharpening is used on black and white images than on color images).
  156.  
  157.       Starting with a 256 color Sun raster image, baz.clr, generate a NeXT
  158.     readable 2bit grayscale image (note fbm2tiff is not a filter, but
  159.     writes to a named file.  Tiff2fbm reads a named file):
  160.  
  161.             -- Without Dithering --
  162.       % clr2gray < baz.clr | \            (convert to gray)
  163.     fbm2tiff -N baz.tiff            (chop 8bit grays to 2bit)
  164.  
  165.             -- With Dithering (note 1) --
  166.       % clr2gray < baz.clr | \            (convert to gray)
  167.     fbnorm | \                (normalize, optional)
  168.     unmap | \                (convert to RGB)
  169.     fbquant -c4 | \                (fbquant also dithers RGB)
  170.     clr2gray | \                (back to gray: 0, 85, 190, 255)
  171.     fbm2tiff -N baz.tiff            (convert 4 grays to NeXT 2bit)
  172.  
  173.     Note 1: Yes, this is gross...and inefficient.  But the
  174.     images look fine.  Dithering should be an option of fbm2tiff,
  175.     and really the halftoning algorithms should be generalizes
  176.     to produce more than just bitmaps.
  177.  
  178. Notes on the 'fbext' program
  179.  
  180.     Usage:    fbext [ -w<width> -h<height> -W<maxwdith> -H<maxheight>
  181.                 -s<size> -a<aspect> -t'title' -c'credits' ]
  182.              [ x y [ width height ] ]
  183.         < foo.fbm > bar.fbm
  184.  
  185.     fbext (bitmap extract) is a very useful anmd multipurpose program.
  186.     Its basic operation is to copy a rectangular portion of one image
  187.     (color or black and white) to a second image, possibly changing
  188.     either the width or height or both.  It can also change the title
  189.     or credits fields of the image.  Because it is so versatile, there
  190.     are a host of options:
  191.  
  192.     -w<num>  or  -h<num>    Force width and/or height to a certain size
  193.     -W<num>  or  -H<num>    Limit width and height to a certain size
  194.     -a<num>            Force the output to have a given aspect ratio
  195.     -s<num>            Scale image to have no more than a given
  196.                 number of pixels.
  197.     <x0> <y0> <width> <height>  select a rectangular region of the image
  198.                 to extract.  The default is the entire image.
  199.  
  200.     Note that the output size limits are cumulative.  Thus if you set a
  201.     maximum width, height, and number of pixels, the image will be the
  202.     smallest of the three limits.
  203.  
  204.