home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR16 / GIF2TXT.ZIP / GIF2TXT.TXT < prev   
Text File  |  1991-04-21  |  3KB  |  67 lines

  1. GIF2TXT
  2.  
  3. GIF2TXT is a method for converting GIF images to ASCII text files. The
  4. result can be displayed on a screen or sent to a printer. Most of the work
  5. is done by PICLAB. (PICLAB.EXE lib 14 "Misc Util & Code" of PICS forum).
  6. This package consists of 3 parts, a PICLAB script - GIF2TXT, a PICLAB MAP
  7. file - CHR.MAP, and little program which inserts CR/LFs in the file from
  8. PICLAB - CHRNL.EXE.
  9.  
  10. PICLAB is a self extracting archive so you just run it and it will produce
  11. the executables and doc files. There are 2 EXEs: PL286 for 286 and up
  12. machines and PL for the rest.
  13.  
  14. To perform the transformation do the following:
  15.  
  16. PL286 GIF2TXT <GIFfile> <TEXTfile> <width> <height>
  17. (use PL for XT or similar machines)
  18.  
  19. A sample run for a full screen image (640 x 480 or 320 x 200 original) would
  20. be:
  21.  
  22. PL286 GIF2TXT MYGIF MY.TXT 80 25
  23.  
  24. Before running GIF2TXT you need to figure out the size in characters of the
  25. final text "image". For a standard screen display this is 80 x 25. If your
  26. original is not the standard screen aspect ratio (1.333333) you will need to
  27. compute a different size text file.
  28.  
  29. The "magic number" used in the calculation is:
  30. (80 / 25) / 1.333333
  31. This is: 2.4  in the following equations this will be refered to as MN.
  32.  
  33. First an example:
  34.  
  35. Lets say you have an image which is 350 x 480 and you want it to display on
  36. a standard screen, thus you will use 25 as the height and you need to
  37. compute the width.
  38.  
  39. width = (350 / 480) * 25 * 2.4
  40. equals 44 ,  thus the text image is 44 x 25. If you know the hight (in
  41. charcters) and you want to compute the width use:
  42.  
  43. char_width = (orig_width / orig_height) * char_height * MN
  44.  
  45. if you know the width you want and need to compute the height use this
  46. equation:
  47.  
  48. char_height = ((orig_height / orig_width) * char_width) / MN
  49.  
  50. For example let's say you want to print the above image on a 80 character
  51. wide printer, you know the width (80) but need to compute the height.
  52.  
  53. height = ((480 / 350) * 80 ) / 2.4
  54. equals 46.
  55.  
  56. GIF2TXT works best with simple high contrast images. You will probably have
  57. to play a bit with brightness and contrast to get good looking grayscales
  58. from photgraphic type GIFs.
  59.  
  60. As it comes, GIF2TXT is designed for a usual CRT screen, black background
  61. with white (or green or amber) characters. Since a printer prints black
  62. characters on a white background, the image will be a negative of the
  63. original GIF image. You can use the PICLAB command NEGATE to invert the
  64. image before running through GIF2TXT if you will be sending the results to a
  65. printer. The contrast and brightness adjustments will be different for a
  66. printer than for the screen.
  67.