VGAIMAGE Version 1.2 11/12/89 By: Hoke Johnson VGAIMAGE is a shareware image viewer/maker program for the IBM PC. It is optimized for use with VGA cards and monitors but allows viewing of Gif images on EGA monitors but currently is really only good for 16 color EGA Gif pictures. VgaImage was created to provide many additional image viewing features which I haven't been able to find in other image viewing programs. This is the third release of VGAIMAGE and it currently supports GIF and TIFF file formats. NEW FEATURES: VGA 360x480x256 mode support for standard VGA VGA 320x400x256 mode support for standard VGA Virtual Screen Disk Buffer to process files larger than VGA screen. 50 percent reduction works on more modes. FEATURES: Gif file viewing and processing Viewing and processing of 2, 16 and 256 level B&W Tiff files Conversion of Halftoned and 16 level Tiff files to 64 level Gif files Conversion of 256 level Tiff files to 256 level Gif files Support for Paradise VGA boards in 640x400x256 mode High Resolution VGA Support for Tseng Labs VGA boards (Orchid Designer VGA) and Paradise VGA boards Zoom mode support for Tseng Labs VGA boards 360x480x256 and 320x400x256 mode support for standard VGA boards 16 level Gray Scale display of Gif files on normal VGA boards at 640x480 16 level Gray Scale display of Gif files on Tseng Labs boards at 1024x768 50% size reduction on large Gif files to fit them on the screen and ability to write them as reduced size Gif files Gif and Tiff header display Brightness controls Smooth Vertical scrolling of large images Setting of the number of bits of resolution to be used for the RGB primaries (Between 1 and 6 bits of resolution) STARTUP PARAMETERS: Usage: vgaimage [GCType] Where GCType is: one of the following graphic card types: EGA, SUPEREGA, VGA, DESIGNERVGA, PARADVGA Graphic card type can also be changed once the program is running by pressing the "D" key. HARDWARE REQUIREMENTS: IBM PC with at least 256K memory and a VGA or EGA graphics card and suitable monitor. The graphics card should also have at least 256K of memory. A hard disk is not required but is recommended if the Virtual Disk Buffer is used since it performs a large number of I/O, a large RAM disk works even better. This program works well with standard VGA cards, VGA cards based on the Tseng labs chip set (such as Orchid Designer VGA cards etc) and on Paradise VGA boards. With the standard VGA card, resolutions of 320x200x256, 320x400x256, 360x480x256 and 640x480x16 shades of gray are possible. With the Tseng labs based cards all the modes of the standard VGA card are possible plus 640x480x256, 800x600x256 and 1024x768x16 shades of gray. With the Paradise VGA cards all the modes of the standard VGA card are possible plus 640x400x256 colors. The extended modes of the Tseng labs based cards (800x600x256 and 1024x768x16) require multi-sync monitors. USING VGAIMAGE Once VGAIMAGE is started, a list of available files for viewing is displayed in the file section which is the upper 2/3 of the screen and a control panel is displayed in the control section which is the lower 1/3 of the screen. The file section is used to select files for viewing or conversion and the control section is used to control the way files are displayed and converted. The file selection contains a list of available files that match the input file type. File types currently supported are Tiff and Gif, Tiff files must have an extension of .TIF and Gif files must have an extension of .GIF . Change the highlighted file by using the cursor arrow keys as well as the home and end keys. With desired file selected press the enter key to view the selected file, when done viewing press the enter key again to return to file selection mode. Currently the first 120 files in the current directory are available for viewing. The control section shows the current state of the display control variables. Each variable is preceded by a description and an upper case letter in parentheses. The state of the variable is changed by depressing the letter in parentheses, either upper or lower case. For example: Display Type (D): VGA This example shows that the current display type is VGA and to change to another display type, press the "D" key to sequence through all possible display types. The available control variables and other keys that do things are described below: F1 - Help Screen I - Changes the input file type for viewing. Currently GIF and TIFF are supported. Files must have extensions .GIF and .TIF respectively. O - Changes the output file type to be written during a write command. Currently only GIF is supported. F9,\ Change directory. Press F9 or \ and then respond with the desired new directory followed by a Carriage Return. D - Change the display type. Pressing the "D" key sequences through all the currently supported Graphic Card types. A - Aspect adjustment flag on/off. The aspect adjustment flag is normally on and affects the display when the display type is set to standard VGA and the 360x480x256 mode is being used. The result is that every other pixel in the horizontal dimension is discarded. Normal aspect GIF files such as 640x480 images should be viewed with this flag on, there are some GIF images that have a 360x480 size with the aspect already adjusted, these should be viewed with the aspect flag off. H - Causes the file header contents to be displayed prior to the image being displayed. Header remains displayed until an "enter" or CR is pressed. L - Causes the display program to shrink the displayed image by 50% in both the horizontal and vertical directions. This mode now works in VGA 320x200 mode as well as some of the super VGA modes such as 640x480, 800x600 and 640x400. It doesn't work in 360x480x256 mode. E - Changes to a 16 level gray scale display mode for Gif files. For normal IBM VGA type boards this gives a 640x480 display with 16 levels of gray. With Designer VGA boards (Tseng Labs) it is possible to switch between 640x480 and 1024x768 modes at 16 levels of gray by using the F8 key. F8 - High Resolution Lock mode. This is only usable with the Designer VGA type boards or boards with Tseng Labs chips. This gives 800x600 and 256 colors with the VGA 16 color B&W mode disabled (E key) and 1024x768 and 16 levels of gray with the VGA 16 color B&W mode enabled. (A multisync monitor is also required) F10 or ESC are used to exit from VGAIMAGE. S - Sets internal special flag which allows a modified Orchid Designer VGA board to display 800x600x256 mode properly. Normally this setting should be left alone (ie OFF), if anyone is interested, write me for details. G - In Gif view mode this key selects the number of bits of resolution for each primary color to use when viewing. In Tiff view mode this key is used to select the number of levels of gray to use when the Tiff file is displayed. This value can be 2, 16, 64 or 256. Not all Tiff files can be viewed in all possible levels of gray output. The supported Tiff renderings are: 2 level Tiff to 2 level display 2 level Tiff to 64 level display 16 level Tiff to 16 level display 16 level Tiff to 64 level display 256 level Tiff to 256 level display V - Virtual Disc Buffer Enable/Disable. When the Virtual Disc Buffer is enabled, the bytes of each scan line as they are read from either a GIF or a Tiff file are written into a disc file VGAIMAGE.VRT. This allows images larger than the available screen memory to be processed. COMMANDS WHILE IMAGE IS BEING VIEWED B - Changes image to BW equivalent picture C - Restores original color picture T - Decreases the number of bits of resolution for each primary. Values supported are 1 to 6 bits of resolution. This can be used to get a rough idea on the amount of resolution that a given image has by starting out at the maximum and reducing until you can see a deterioration in the image quality. G - Complement to the T command, increases the number of bits of resolution for each primary. + - Increase the brightness of the displayed image. (-) - Decrease the brightness of the displayed image. 0 - Restore image to its original brightness (Zero key) W - Writes the currently displayed image in the specified outfile format. Currently only GIF is supported. The actual image can be longer than the display screen, for instance 640x819 for the Designer VGA card. Large files can be output in GIF format in a minute or two on an AT machine. The output filename of the new file is the same as the first filename with the new extension if we are converting from one file type to another. If the intended new filename already exists, a new filename is used which has the last letter of the filename "incremented". If the Virtual Disc Buffer is not enabled, VGAIMAGE reads the image from the display memory and creates the output file, this works for VGA 320x200x256, DESIGNERVGA 320x200x256, 640x350x256, 640x480x256, 800x600x256 modes. If "W" is pressed without Virtual Disc Buffer enabled and a display mode other than those just mentioned is in use, VGAIMAGE terminates the display of the current image and returns to the file selection menu. If the Virtual Disc Buffer is enabled, VGAIMAGE reads the image from the Virtual Disc Buffer file VGAIMAGE.VRT and creates the output file. The Virtual Disc Buffer only functions when the display type is one of VGA, DESIGNERVGA or PARADVGA. Images larger than the display can be handled with the Virtual Disc Buffer. Currently you can tell that the GIF write process is in progress by the disk busy light, the completion of the write process is signalled by two short beeps. Z - Turns Zoom mode on and off for Tseng boards (Designer VGA) < - Decrease Zoom factor (actually the "," key) > - Increase Zoom factor (actually the "." key) While in Zoom mode you can scroll around the picture by using the Home, PGup, PGdn, and cursor arrow keys. M - Smooth vertical scrolling of images which are larger than the display screen. This is usable on Designer VGA boards and VGA boards with images that have a height greater than 480 lines. NOTES ON USING THE VIRTUAL DISC BUFFER The Virtual Disc Buffer is a disc based copy of the pixels which make up an image. It allows for images larger than the display memory to be converted or processed. It also allows for images which VGAIMAGE can't readback from display memory to be converted or processed. The virtual disc buffer should only be enabled when you want to output a GIF file such as when you are converting from Tiff to GIF or when you are adjusting the brightness on a GIF file or doing a 50% reduction on a GIF file. If the virtual disk buffer is enabled all the time, VGAIMAGE will operate much slower due to the great increase in extra I/O. A file VGAIMAGE.VRT is created in the current directory and used as the virtual disc buffer, upon exit of VGAIMAGE, the file VGAIMAGE.VRT is left and is not deleted, if space is a problem, be sure to delete the VGAIMAGE.VRT files. The virtual disk buffer shouldn't be with a floppy drive unless you are prepared to wait a very long time since the virtual disc buffer requires a lot of I/O. For best results use with a large Ram Disc or a fast hard disk. VGAIMAGE can read interlaced images but normally only outputs non-interlaced images. The one exception is for a GIF image which is already interlaced and is displayed with the virtual disk buffer enabled, a subsequent write of that image will be as an interlaced image. NOTES ON VIEWING TIFF FILES AND MAKING GIF FILES FROM TIFF FILES Black and White Tiff files can be viewed and converted into Gif files. Tiff file support is currently only available for VGA type boards. Tiff files with 1 bit per pixel, 4 bits per pixel and 8 bits per pixel are supported. When viewing Tiff files with 1 bit per pixel, and Tiff Gray Levels set to 64, VGAIMAGE converts to an image with 64 levels of gray. In doing so the pixel width and height of the original Tiff Image is reduced by a factor of eight. For instance a 1 bit per pixel Tiff image with a width of 4800 pixels and a height of 6400 pixels will reduce to an image with a width of 600 pixels by a height of 800 pixels where each pixel has six bits per pixel. It is also possible to view Tiff images without the conversion to 6 bits per pixel by setting the Tiff Gray Levels to 2 by pressing the G key. Currently it is not possible to make a valid Gif file when there is only one bit per pixel. When viewing Tiff files with 4 bits per pixel, VGAIMAGE can display an image with either 16 or 64 levels of gray. The Tiff Gray Levels setting controls which mode is used (G key). When viewing Tiff files with 4 bits per pixel and 64 levels of gray displayed, the height and width of the image is reduced by a factor of 2, thus a 1200 x 960 image will reduce to 600 x 480. VGAIMAGE has been tested with a few 256 level Tiff files, this type of Tiff file should produce the best results. The 6 bit per primary limitation of the VGA card causes the displayed image to be of only 64 levels but the full resolution is maintained when creating an output GIF file. (If the 256 level Tiff file is brightened or darkened prior to saving as a GIF then the gray scale levels will be rounded off to 6 bits or 64 gray levels in the palette) VGAIMAGE has been tested with Tiff files created by HP Scanning Gallery and with Tiff files created by HALO DPE. Good image results are achieved by using HP Scanning Gallery, using the Fatting Dither setting and a custom resolution of 600 dots per inch. Experiment with setting the brightness control to "Lighten" and "Normal" to find the best result. This allows a normal A size sheet of paper to be scanned and produces an image of approximately 600 x 800 with 64 levels of gray. Normally it is necessary to brighten the image by pressing the "+" key approximately 6 to 10 times prior to saving the image as a Gif file. The Tiff files produced using this method vary from 2.5 to 4.4 Megabytes but can be compressed using one of the available "archiving" utilities to produce files < 1.2 Mbytes which allows them to be stored on 1.2 M floppies and thus moved between machines. Images can be produced using the 16 levels of gray however I have found that the images are usually darker and need to be brightened so much that you loose image quality. The 16 levels of gray would probably do well on a picture that was very bright to start with. Images that are dark to start with generally don't scan well. SHAREWARE: VGAIMAGE is user supported software. VGAIMAGE is made available for a free ten day trial period. If you find VGAIMAGE useful, you may license the program for non-commercial use on one machine by sending $15.00 to: Hoke Johnson P.O. Box 35602 Monte Sereno, CA 95030 All other rights reserved. VGAIMAGE may not be modified in any way by anyone other than the author. VGAIMAGE may be freely distributed to others only in its complete and unmodified form with no fee charged other than postage, media or duplication charges. Regardless of how your copy of VGAIMAGE was obtained, it is requested that you comply with the above licensing agreement. All warranties are disclaimed, including damage to hardware and/or software from use of this product. FUTURE ENHANCEMENTS The following are some of the planned future enhancements: -Support for more types of high resolution VGA boards -Color GIF file creation from scanned Tiff files -Pseudo 640x400x256 color mode on standard VGA -Better error checking during GIF decoding -PCX file format support -Support for more types of TIFF files (64 gray level) -Test escape (ESC) key during image decoding or writing to abort current action. FEEDBACK AND COMMENTS I welcome your comments, you can contact me by mail Hoke Johnson P.O. Box 35602 Monte Sereno, CA 95030 For now, I do not plan on trying to support compressed Tiff files since the packages I have seen have the option of specifying whether the output Tiff file is compressed or not and the compression efficiency is not that good anyway. KNOWN BUGS, FEATURES OR LIMITATIONS: - When using virtual disk buffer, a file VGAIMAGE.VRT is created in the currently selected directory, this file is not deleted when VGAIMAGE terminates and thus the temporary file VGAIMAGE.VRT is left undeleted. This file contains a sequence of bytes which are the values of the pixels for the last image which was decoded while the virtual disk buffer was enabled. A source for the uncompressed bytes of a Gif image. - Empty Gif files are created in the current directory. This happens when trying to write a Gif file and the Virt Disk Buffer is not enabled and the display mode is one which cannot be read. For example displaying in Paradise 640x400 mode with the Virt Disk Buffer disabled. - Some modes don't vertically scroll or pageup and pagedown smoothly and tend to cause the picture to jump sideways, this happens on the PARADVGA mode. - When using the 50% reduction and vertically moving the picture with either the pageup/pagedown keys or the "m" key, the scrolling continues on beyond the bottom of the picture and sometimes the top of the picture will start to appear at the bottom only shifted sideways. This also happens on the 1024x768x16 B&W mode on the Designer VGA. - 2 level Tiff files can be viewed but cannot be saved correctly as GIF files. CHANGES: VGAIMAGE Version 1.0, 03/27/89 - Initial Release VGAIMAGE Version 1.1, 05/15/89 - Fixed problem which didn't sort directory listing properly when there were only two files to be displayed - Enhanced GIF output routine to produce maximally compressed files and improved speed drastically by using hashing and improving the disk i/o routines. - Added support for displaying 640x400x256 colors on the Paradise VGA board. - Decreased the amount of memory required for displaying very large GIF files. - Added additional Tiff Tag handling and allowed program to attempt to display image even if there are some unhandled tags. A list of unhandled tags is also listed when the Header display is enabled. - Added support for 256 level Tiff files VGAIMAGE Version 1.2, 11/12/89 - Allow files to be opened which are secured as read-only - Fixed error handling of opening invalid Tiff files - Added Virtual Screen Disc Buffer support which allows image conversion on images which exceed the size of the display memory. - Added support for 360x480x256 and 320x400x256 modes on the standard VGA card. For the 360x480x256 mode there is an aspect adjustment flag which allows 640x480x256 images to display. - Added line clipping when displaying images larger than the screen. - Added support for 50 percent reduction on super VGA modes such as 640x480x256, 800x600x256 and 640x400x256.