home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / GIFDEV.ZIP / TGIF.DOC < prev    next >
Text File  |  1989-04-10  |  6KB  |  166 lines

  1.  
  2.  
  3.  
  4. Welcome to tgif, the Two-toned GIF utility!
  5.  
  6.  
  7. Tgif is a utility program to display color graphic images on a plasma,
  8. LCD or monochrome graphics display.  The input format is the Compuserve
  9. GIF format for color images.  Tgif unpacks these GIF files and performs
  10. a halftone process on the image so that the various colors of the
  11. palette are displayed using patterns of black and white pixels that
  12. approximate the intensities of each color.  This is the same process
  13. that allows images to be printed in black and white media such as books
  14. and newspapers.  The algorithm used to perform the halftone
  15. transformation is an error distribution process developed by R.  W. 
  16. Floyd and L. Steinburg. 
  17.  
  18. Tgif starts by computing the intensity of each palette color by summing
  19. the values of the red, green and blue intensities supplied in the GIF
  20. image.  A threshold intensity level is computed to represent the average
  21. intensity of all colors in the palette.  This threshold value is used to
  22. make the decision as to whether a displayed pixel is black (pixel <=
  23. threshold) or white (pixel > threshold).  Unless the pixel displayed is
  24. exactly black or white, an intensity error is incurred.  This error
  25. represents the difference between the pixel's intensity and what was
  26. actually displayed.  When distributed among the neighboring pixels, this
  27. error influences the threshold decision for those pixels and changes
  28. their display values thus creating a distribution of black and white
  29. pixels that approximates the color intensity. 
  30.  
  31. The above algorithm not only produces excellent visual results, it also
  32. provides a remarkable and unexpected feature when the image is enlarged. 
  33. Tgif provides option switches to enlarge the image beyond the size
  34. supplied by the GIF file.  What this actually does is increase the
  35. number of pixels in the drawing.  In the instance of a double size
  36. image, when a single pixel is unpacked from the GIF file tgif creates
  37. four pixels of the same color; a block of four pixels where there was
  38. just one.  The result is the same image but with pixels twice the
  39. original size.  When this "big bit" image is halftoned by tgif, the "big
  40. bits" are resolved into an image that actually has more detail than the
  41. smaller version of the same image.  In other words, the big pictures
  42. look better, have more detail and look just as smooth as the smaller
  43. images.  Images can be enlarged to triple size with the same results. 
  44. Only when enlarged to quadruple size did the resulting image start to
  45. get blocky and degraded, although this might be cured by increasing the
  46. fractional part of the error accumulators used in the algorithm. 
  47.  
  48. Tgif was developed to run using Toshiba plasma type display screens with
  49. 640 by 400 resolution (T3100, T3200, T5100).  If no command line option
  50. is used, tgif will attempt to set the video mode to the special mode
  51. 0x74 used by Toshiba plasma screens.  A command line option forces tgif
  52. to use any CGA type adapter and another option will force inverse video
  53. for CGA compatible LCD displays.  The CGA mode used by tgif is the 640
  54. by 200 two color mode (mode 6).  Since the aspect ratio of the pixels in
  55. this mode is not 1:1 (that is, CGA pixels are taller than they are wide)
  56. it is recommended that the command line option to widen the image be
  57. used. 
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. The usage of tgif is as follows:
  74.  
  75.  
  76. Usage:     tgif {/w} {/l} {/d} {/t} {/r} {/c} giffile{.ext}
  77.  
  78. Options:   /w == widen image
  79.            /l == lengthen image
  80.            /d == double size
  81.        /t == triple size
  82.            /r == reverse video (for LCD screens)
  83.            /c == force CGA mode
  84.  
  85. Example:   tgif/d/r picture
  86.            Would open picture.GIF and display a double size
  87.            image in reverse video.
  88.  
  89. Notes:
  90.  
  91.       Command line options are stacked onto the program name and 
  92.       separated by slashes.
  93.  
  94.       If a filename extension is not included, ".GIF" is assumed.
  95.  
  96.  
  97. Once invoked, tgif starts unpacking and halftoning the GIF image. If the
  98. image is supplied in interlace mode, tgif uses two passes; one to unpack
  99. and de-interlace the raster lines and a second to halftone the pixels.
  100. For non-interlaced images, one pass performs both operations. As the
  101. color image is halftoned, the black and white raster data is stored into
  102. memory until the entire image has been completed. Tgif provides status
  103. displays about the GIF file as it is being processed.
  104.  
  105. Once completed, tgif shifts into an image display mode where the user
  106. may view the image.  If the completed image is larger than the selected
  107. display size, the arrow keys may be used move the display window to any
  108. part of the image. The active keys are:
  109.  
  110.     key        usage
  111.     
  112.     up-arrow    move window up
  113.     down-arrow    move window down
  114.     left-arrow    move window left
  115.     right-arrow    move window right
  116.     page-up        big move up
  117.     page-down    big move down
  118.     home        display top of image
  119.     end        display bottom of image
  120.     escape        exit tgif
  121.  
  122.  
  123.  
  124.     
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. The source code module tgif.c has been provided for a number of reasons. 
  137. Hopefully it will help others avoid some of the pitfalls encountered
  138. while unpacking and displaying GIF file images.  The included tgif.exe
  139. file was compiled directly from the included tgif.c source module using
  140. MIX software's Power C compiler.  This and many other "c" projects have
  141. convinced me that this compiler is one of the greatest values in the
  142. world of computing.
  143.  
  144. You will also notice that the source code statements in tgif.c are
  145. uncommented.  Since this is a shareware product, you are requested to
  146. support this effort with a $10 shareware fee.  Fully commented listings
  147. as well as future enhancements will be available to registered users of
  148. tgif.  One enhancement that is foreseeable is the conversion of certain
  149. procedures into assembly language to increase the speed of tgif's
  150. processing. 
  151.  
  152. The reporting of any bugs, anomalies or GIF files that tgif cannot
  153. display would also be appreciated. 
  154.  
  155. To all novice or beginning users, tgif is offered for your entertainment
  156. and possibly educational uses.  To all of you experts I offer a friendly
  157. challenge: now that you have the source code, make tgif better in some
  158. way and let me know how you did it. 
  159.  
  160. This code was written and will be supported by:
  161.  
  162.     James Lark
  163.     6101 W. Courtyard Dr.
  164.     Austin, TX. 78730
  165.  
  166.