


IMTIFF(3IM)            SDSC IMAGE LIBRARY             IMTIFF(3IM)



NAME
     imtiff - Aldus and Microsoft TIFF (Tagged Image File Format)
     translation

SYNOPSIS
     #include <stdio.h>
     #include "sdsc.h"
     #include "im.h"

     int ImFileRead( fd, "tiff", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFRead( fp, "tiff", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileWrite( fd, "tiff", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFWrite( fp, "tiff", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;


DESCRIPTION
     tiff is a generic Tagged  Image  File  Format  developed  by
     Aldus  and Microsoft in conjunction with leading scanner and
     printer manufacturers.  tiff files may  contain  images  and
     miscellaneous  other image-related items.  Such files may be
     created and manipulated by a variety of  Tagged  Image  File
     Format  tools.   See the Tagged Image File Format documenta-
     tion for details on how to use these tools.

     tiff support within the SDSC image  library  is  limited  to
     images of certain depths and storage methods.

FILE RECOGNITION
     tiff files are recognized by  the  following  filename  suf-
     fixes: .tiff and .tif.

NOTES
     SDSC image library support of the  tiff  format  adheres  to
     tiff  Specification  5.0  and tiff Software Release 2.3.  In
     particular tiff Classes B, G, P, R, are  all  supported  for
     read and write with the following exceptions:




SDSC              Last change: August 19, 1992                  1






IMTIFF(3IM)            SDSC IMAGE LIBRARY             IMTIFF(3IM)



          tiff  directories  that  are  written  do  not  include
          NewSubfileType  tags.  NewSubfileType indicates how one
          image within a tiff file is related to other images  in
          the file.

          tiff directories that are written do not include  Reso-
          lutionUnit  tags.  ResolutionUnit indicates whether the
          unit of pixel measure is none, inch, or centimeter.

          tiff R image files that are written do not include  the
          new 5.0 colorimetric information tags.

     Tags not recognized on reading are ignored unless  the  cal-
     ling program has requested verbosity.

     SDSC image library support  of  the  tiff  format  does  not
     require  use  of the Tagged Image File Format's tiff library
     libtiff.a and contains no  proprietary  code.   tiff  format
     handling  is  available  on  any  machine for which the SDSC
     image library is available.

  Reading TIFF image files
     The SDSC image library can read tiff image files with one or
     more images and map them to VFBs as follows:

          Depth/color          Types of compression   Mapped to VFB
          1-bit monochrome     Uncompressed, LZW,     IMVFBMONO
                               Mac PackBits

          4-bit color index    Uncompressed, LZW,     IMVFBINDEX8
                               Mac PackBits

          8-bit color index    Uncompressed, LZW,     IMVFBINDEX8
                               Mac PackBits

          16-bit color index   Uncompressed, LZW,     IMVFBINDEX16
                               Mac PackBits

          24-bit RGB           Uncompressed, LZW,     IMVFBRGB
                               Mac PackBits

          32-bit RGB+Alpha     Uncompressed, LZW,     (IMVFBRGB | IMVFBALPHA)
                               Mac PackBits

     8-bit and 16-bit images may  have  associated  color  lookup
     tables.

     RGB images may be scanline-interlaced  or  plane-interlaced.
     (In   tiff  terminology,  this  is  called  "contiguous"  or
     "separate" planar configuration.)





2                 Last change: August 19, 1992               SDSC






IMTIFF(3IM)            SDSC IMAGE LIBRARY             IMTIFF(3IM)



     Lempel-Ziv Welch compression  (LZW)  and  Macintosh  PackBit
     compression  schemes  are  supported.  CCITT, NEXT, THUNDER-
     SCAN, SGIRLE, and PICIO image compression are _n_o_t supported.

     tiff files may be in MBF (most-significant  byte  first)  or
     LBF  (least-significant byte first) byte order.  _N_o_t_e:  tiff
     documentation refers to MBF as  TIFF_BIGENDIAN  and  LBF  as
     TIFF_LITTLEENDIAN.  TIFF_VERSION is 42.

     Bottom right and top right image orientations are  not  sup-
     ported.

     If the file's image has a color map, the image  library  VFB
     includes a color lookup table.

     Note that 24-bit and 32-bit color indexes are  truncated  to
     the lower 16 bits when the file is stored as an IMVFBINDEX16
     VFB.

  Writing TIFF image files
     Images to be written out are mapped from image library  VFBs
     as follows:

          Mapped from VFB         Depth/color          Types of compression
          IMVFBMONO               1-bit color index    Uncompressed, LZW,
                                                       Mac PackBits
          IMVFBINDEX8             8-bit color index    Uncompressed, LZW,
                                                       Mac PackBits
          IMVFBINDEX16            16-bit color index   Uncompressed, LZW,
                                                       Mac PackBits
          IMVFBRGB                24-bit RGB           Uncompressed, LZW,
                                                       Mac PackBits
          (IMVFBRGB|IMVFBALPHA)   32-bit RGB+Alpha     Uncompressed, LZW,
                                                       Mac PackBits

     If the incoming VFB has a  color  lookup  table,  the  image
     written to the tiff file contains one.

     RGB images may be stored in scanline-interlaced  and  plane-
     interlaced modes.  The tiff format does not supprt noninter-
     laced RGB image storage.

     Other image library VFB types are converted to  one  of  the
     above   types   prior   to   being  written  out.   See  the
     ImFileWrite(3IM) man page for details.

ERRORS
     In addition to those listed for ImFileRead(3IM),  tiff  file
     reading returns the following error codes:

          IMECONFLICT      Conflicting information in image header
          IMEDEPTH         Unknown image depth



SDSC              Last change: August 19, 1992                  3






IMTIFF(3IM)            SDSC IMAGE LIBRARY             IMTIFF(3IM)



          IMEHEIGHT        Zero or negative image height
          IMEMAGIC         Bad magic number in image file
          IMEMALLOC        Cannot allocate enough memory
          IMEORIENTATION   Unsupported image orientation
          IMEOUTOFRANGE    Header value out of legal range
          IMEPLANES        Unknown image plane configuration
          IMESYNTAX        Syntax error in tiff file
          IMESYS           System call error in read operation
          IMEUNSUPPORTED   Unsupported VFB type
          IMEVERSION       Bad version number
          IMEWIDTH         Zero or negative image width

     In addition to those listed for ImFileWrite(3IM), tiff  file
     writing returns the following error codes:

          IMEMALLOC   Cannot allocate enough memory
          IMESYS      System call error in write operation

DOCUMENTATION
     _T_a_g _I_m_a_g_e _F_i_l_e _F_o_r_m_a_t _R_e_v _5._0, August 8,  1988,  Tim  Daven-
     port,  Aldus  Corporation,  and Manny Vellon, Microsoft Cor-
     poration.

     See also the man pages with the tiff standard distribution.

SEE ALSO
     ImIntro(3IM),   ImErrNo(3IM),   imconv(1IM),    imfile(1IM),
     imformats(1IM), immpnt(3IM), impict(3IM)

AUTHOR
     T. Todd Elvins
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu




















4                 Last change: August 19, 1992               SDSC



