home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / viewers / grey15 / grey.doc next >
Text File  |  1987-11-17  |  7KB  |  168 lines

  1.  
  2. *****************************************************************************
  3.                                     G R E Y
  4.                            The Greyscale GIF Decoder
  5.                                     Rev 1.5
  6.  
  7.                      Copyright (c) 1987 by Michael Vigneau
  8. *****************************************************************************
  9.  
  10.    GREY is a program that will display a GIF (Graphics Interchange Format)
  11. image in "greyscale", using an IBM CGA card, Hercules card, or equivalent.
  12. GREY can handle any image up to 720 x 400 pixels, and up to 256 total colors.
  13. The program converts all colors to grey values, then displays those values 
  14. using halftoning and dithering techniques.  GREY also supports "true" 
  15. greyscale on a VGA (Video Graphics Array).
  16.  
  17.    GREY requires at least 160K of free memory to run.
  18.  
  19.    The format for GREY is:
  20.  
  21.        [d:path\]GREY [-options] [d:path\]gif-file[.gif]
  22.  
  23.    Options are:
  24.          -c    CGA (default)
  25.          -h    Hercules
  26.          -v    VGA: 64 shades only
  27.  
  28.          Display Modes (CGA and Hercules only):
  29.           0    Black/White only
  30.           1    3 shades, medium res
  31.           2    9 shades, ordered dither
  32.           3    9 shades, slanted dither
  33.           4    33 shades, ordered dither
  34.           5    33 shades, slanted dither
  35.  
  36.          -r    Reverse the image
  37.  
  38.    Options can be in either upper or lower case.
  39.  
  40.    Display modes are selected by entering the mode number after the option,
  41. for example, -c3 .  If no display mode is selected, GREY will display a menu 
  42. of valid choices.  This allows the same image to be loaded once and viewed 
  43. using different display modes.  Display modes are not used with the "-v" 
  44. option.
  45.  
  46.    You can also switch between display modes by pressing the desired number
  47. key while the image is displayed.  The new image will be drawn on top of the
  48. previous image, using the new mode.  This helps show the differences between
  49. the various modes. 
  50.  
  51.    Please note that the mode numbers have changed since the previous version
  52. of GREY.  Some less useful modes have been eliminated, while others have been
  53. added.  Also, the Black/White mode now displays the image full-screen.
  54.  
  55.    The VGA mode draws the image using Mode 13h, known as "multi-color" or
  56. "MCGA" mode.  The palette is set to produce 64 grey scales.  Since this is
  57. performed by the hardware, no dithering or halftoning modes are needed.
  58. VGA mode will also work on PS/2 Models 25 and 30, the 8514/A Display Adapter,
  59. the PS/2 Display Adapter, and "VGA compatible" cards that support MCGA mode.
  60. (The program now uses BIOS to set the mode and palette.)
  61.  
  62.    Of course, the above hardware will support the CGA modes also.
  63.  
  64.  
  65. PRINTING
  66.  
  67.    If you have a "screen dump" program (such as GRAPHICS.COM or HARDCOPY),
  68. you can print the image by hitting the PrtSc (Print Screen) key.  You may
  69. need to reverse the image before printing (see below).
  70.  
  71.    You cannot use this method in VGA mode, unless you have a utility
  72. specifically made to print Mode 13h (MCGA) screens.
  73.  
  74.  
  75. REVERSING THE DISPLAY
  76.  
  77.    If you have an LCD or other display that "draws" in black instead of
  78. white, you should use the "-r" option.  This will reverse the black and white
  79. dots, making the image viewable.  This option can be used in combination
  80. with other options, ex: GREY -C3 -R CHERYL.GIF .
  81.  
  82.    You can also reverse the image by pressing the "R" key while the image is
  83. displayed on the screen.  This may be useful for printing "screen dumps".
  84.  
  85.    The reverse feature is not supported in the VGA mode.
  86.  
  87.  
  88. HOW IT WORKS
  89.  
  90.    GREY first reads the GIF file into memory.  It does this for two reasons.
  91. First, if the image is greater than 320 x 200 pixels, GREY merges the
  92. pixel data into this size.  (This is done mathematically, NOT by skipping
  93. pixels.)  It does this to conserve memory, and to speed up the display. The
  94. second reason for storing the image is to handle "interlaced" files; the
  95. shading algorithms sometimes work with more than one raster line at a time,
  96. and an interlaced image mixes up the order of the lines.  Any interlaced
  97. file is "de-interlaced" while it is being read into memory.
  98.  
  99.    As the file is being read, the colors in the image are converted to
  100. their equivalent grey values.  This produces an exact greyscale 
  101. representation of the color image, similar to a black and white photo of a 
  102. color object.  This "greymap" is then rendered onto the display screen, 
  103. using the chosen Display Mode.
  104.  
  105.  
  106. HALFTONING AND DITHERING
  107.  
  108.    Different display modes work better for some types of images than for
  109. others.  
  110.  
  111.    Choosing "Black/White" (mode 0) forces GREY to create an image where each 
  112. pixel translates to either pure black or pure white.  This feature is included
  113. for comparison with the greyscale versions.
  114.  
  115.    Mode 1 is a 3-shade halftone.  This means that each pixel is either
  116. black, white, or "grey", which is a checkerboard of both black and white
  117. pixels.
  118.  
  119.    Modes 2 and 3 are 9-shade dithers.  Modes 4 and 5 are 33-shade dithers.
  120. Dithering creates dot patterns that approximate grey shades.  Larger dither
  121. patterns produce more grey shades, but tend to "wash out" the image.  GREY
  122. uses two types of dithers, "ordered" and "slanted", each with two pattern
  123. sizes.  The even numbered dither modes are "ordered", the odd ones are 
  124. "slanted".
  125.  
  126.    The ordered dithers use a well-defined pattern that is designed to 
  127. minimize contouring.  Each successive pattern differs from the previous
  128. pattern by only one pixel.  The patterns are built up in an ordered fashion.
  129.  
  130.    A "slanted dither" is my own variation on the ordered dither.  Instead
  131. of building the dither pattern on a square grid, the pattern is created on
  132. 60 degree diagonals.  This eliminates the "x" and "+" artifacts that the
  133. ordered dither produces, as well as the square grid dots on some shades.
  134. However, a different artifact occurs: slanted lines.
  135.  
  136.    At a distance, there is no difference between the ordered and slanted
  137. dithers; the same number of dots are produced in each case.  When viewed
  138. at close range, the slanted dither sometimes produces better results.  Use
  139. whichever pattern you prefer.
  140.  
  141.  
  142. HANDY MS-DOS TIP
  143.  
  144.    To display all GIF pictures in a directory, type the following line at the
  145. DOS prompt:
  146.  
  147.            FOR %X IN (*.GIF) DO GREY %X
  148.  
  149.    Put any options desired between the "GREY" and the final "%X".
  150.  
  151.  
  152. FEEDBACK
  153.  
  154.    If you find GREY to be useful to you, I would like to hear from you.
  155. I am open to suggestions for improvements.  Please correspond via Easyplex
  156. to [76703,4275] or write a letter to:
  157.  
  158.    Michael Vigneau
  159.    25 Emerald St.
  160.    Newton, MA  02158
  161.  
  162. I hope you enjoy using GREY.
  163.  
  164. ----------------------
  165.  GIF and 'Graphics Interchange Format' are trademarks (tm) of
  166.  CompuServe Incorporated, an H&R Block Company.
  167.  
  168.