


IMGIF(3IM)             SDSC IMAGE LIBRARY              IMGIF(3IM)



NAME
     imgif - CompuServe GIF (Graphics  Interchange  Format)  file
     translation

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

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

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

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

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



DESCRIPTION
     GIF (Graphics Interchange Format) is  CompuServe's  standard
     for  generalized  color  raster  images.  This standard is a
     mechanism  to  exchange  and  display  high-quality,   high-
     resolution graphics images.

FILE RECOGNITION
     CompuServe gif files are recognized  by  the  filename  suf-
     fixes: .gif and .giff.

NOTES
     SDSC image library support of CompuServe's gif  format  con-
     tains  no  proprietary code.  CompuServe gif format handling
     is available on any machine for which the SDSC image library
     is available.

  Reading CompuServe GIF files
     The  SDSC  image  library  reads  LZW   (Limpel-Ziv   Welsh)
     compressed  color  index  images  with depths of 1 through 8
     bits, with or without a CLT.  1-bit  images  are  stored  as
     IMVFBMONO  VFBs,  while  2- through 8-bit color index images



SDSC              Last change: August 24, 1992                  1






IMGIF(3IM)             SDSC IMAGE LIBRARY              IMGIF(3IM)



     are stored as IMVFBINDEX8 VFBs.

     If the gif file contains multiple images, multiple VFBs  are
     created  and  appended  to  the  _d_a_t_a_T_a_b_l_e.   The SDSC image
     library reads both gif 87a and gif 89a.

  Writing CompuServe GIF files
     SDSC  image  library  IMVFBMONO  VFBs  are  written  as  LZW
     compressed 1-bit images, with or without a CLT.  IMVFBINDEX8
     VFBs are written as LZW compressed  8-bit  images,  with  or
     without a CLT.

     Other image library VFB types are converted to IMVFBMONO  or
     IMVFBINDEX8  VFBs  prior  to  being  written  out.   See the
     ImFileWrite(3IM) man  page  for  details.   The  SDSC  image
     library writes only gif 87a files.  This allows maximum por-
     tability of the file, since gif 89a decoders can  also  read
     gif 87a.

     The gif format can support multiple images in a single file,
     with  the  restriction  that  all  such images have the same
     depth.  The SDSC image library currently  does  not  support
     storage of more than one image in a single gif file.

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

          IMEMAGIC    Bad magic number of GIF file
          IMEMALLOC   Cannot allocate enough memory
          IMESYS      System call error in read operation

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

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

DOCUMENTATION
     _G_I_F _G_r_a_p_h_i_c_s _I_n_t_e_r_c_h_a_n_g_e  _F_o_r_m_a_t  _V_e_r_s_i_o_n  _8_9_a,  CompuServe,
     July 31, 1990.
     _G_I_F _G_r_a_p_h_i_c_s _I_n_t_e_r_c_h_a_n_g_e  _F_o_r_m_a_t  _V_e_r_s_i_o_n  _8_7_a:  _A  _s_t_a_n_d_a_r_d
     _d_e_f_i_n_i_n_g  _a  _m_e_c_h_a_n_i_s_m  _f_o_r  _t_h_e _s_t_o_r_a_g_e _a_n_d _t_r_a_n_s_m_i_s_s_i_o_n _o_f
     _r_a_s_t_e_r-_b_a_s_e_d  _g_r_a_p_h_i_c_s  _i_n_f_o_r_m_a_t_i_o_n,  CompuServe,  June  15,
     1987.

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

AUTHOR
     Soraya Gonzalez, Toan-Vinh Le



2                 Last change: August 24, 1992               SDSC






IMGIF(3IM)             SDSC IMAGE LIBRARY              IMGIF(3IM)



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





















































SDSC              Last change: August 24, 1992                  3



