home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / fbm / readme.txt < prev   
Text File  |  1994-06-01  |  8KB  |  206 lines

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