Byers, J.A. 1999. Flash Cards and Animation Software for
Education. Educational Media International 36:164-167.  pdf


John A. Byers
Department of Plant Protection, Chemical Ecology
Swedish University of Agricultural Sciences
SE 230 53 Alnarp, Sweden

Abstract
PCX-13.EXE is a software program for computers running DOS/Windows that transforms PCX image files (converted from GIF or other format) to raw binary files (ending in A13) suitable for display by FLASH.EXE. The latter program takes a text file with a list of A13 image files and displays these either at random or in sequence for a specified time from as little as 25 milliseconds up to 5 minutes. The pictures are displayed at 320 x 200 resolution in 256 colors from a palette of 262,144. The images can be displayed as "flash cards" that pose questions that must be answered by students or as an animated series of images. Up to 2000 image files can be repeatedly displayed from a list in a file, and many such file lists can be run from a batch file (*.BAT).

Introduction

Flash cards are an old and accepted way of testing one's knowledge of a subject. An image or word phrase is shown on a card which requires a verbal or written answer. The cards are "flashed" either in sequence or usually at random. After a reply is given, the correct answer is shown either on the back of the card, by the teacher, or checked some other way by the student so that next time the card is presented an appropriate response can be given. Flash cards can be used in group learning or individually.

Computer images can be shown for relatively long periods to illustrate topics, as are photo slides and overheads, or more rapidly in animation sequences. The first animations were in fact a packet of "flash cards" fanned by hand to rapidly show similar pictures, changing incrementally, that simulated movement. Nowadays, video cameras can show real-time animations. However, images from still-video and digital cameras can simulate time-lapse animations or high speed movements if the images are shown in rapid sequence.

Software is presented here that can use PCX image files and convert them to raw binary format for rapid display as flash cards or animations by personal computer. The advantage of the software is that even older, slower computers limited in Windows to 16 colors, can show animations in 256 colors. The software runs either in DOS or from an icon in Windows 3.1/95/98.

Converting PCX/GIF and other images to raw binary format

The software for presenting animations and flash cards requires images in raw binary format that can be loaded by QuickBASIC's BLOAD command. My program PCX-13.EXE is used to convert PCX image files (Okonski, 1992) to A13 format (the extension used here for raw binary format). Many shareware and commercial programs inter-convert various popular image file formats such as GIF (graphic interchange format, CompuServe), TIF (tagged interchange format), BMP (Windows bitmap), PCX (ZSoft), and WPG (Word Perfect graphic). For example, GWS.EXE (Graphic Workshop: Alchemy Mindworks Inc., PO box 500, Beeton, Ontario L06 1A0, Canada) is an inexpensive shareware program that is useful for converting GIF to PCX. Drawings and art work can be made by commercial programs (e.g., Corel Draw or Windows Paintbrush) and the resulting images exported as PCX or BMP (Windows Paintbrush). The BMP files, or internet GIF files, are converted by GWS to PCX, and then these are converted to A13 format by PCX-13.EXE.

185K partial animation? To give an example, an animation with a feeling of high speed movement through a forest was made by taking pictures every 2-3 m with a Canon ION still-video camera, digitizing the pictures to TIF format (Canon ION software), and then using Corel Draw 3.0 (or 7.0) to convert to PCX format. Finally, each PCX file was converted to binary image format (A13) at 320 x 200 pixels suitable for QuickBASIC's BLOAD command with my program PCX-13.EXE (available on the internet, see end of article).

The program also makes an associated color palette file with 256 numbers that represent colors from among 262,144 possible according to a mixing of red, green and blue, each of 64 intensities ranging from 0 (no color) to 63 (thus 64 x 64 x 64 = 262,144 colors). For example a pinkish skin color with 60 for red, 50 for green and 40 for blue would have a number equal to 65536 x blue + 256 x green + red, or 2,634,300. The palette file has the same parent name as the image but ends in 13P. The A13 images have 64,000 pixels of which there can be up to 256 kinds assigned any of the 262,144 colors. The palette and image files are compatible with TAXOKEY software in systematic biology (Byers, 1996a; see end of article for download information).

Making a list of images for viewing

A text file of any name (made with a text editor such as DOS's EDIT.COM, most word-processors, or Window's NOTEPAD) contains a list of names of the image files. The text file (e.g. PICLIST.TXT) might look like the following:

c:\work\begin1 10
ant1 5
ant2.A13 5

The first image could introduce the topic for 10 seconds, then the image ANT1.A13 would display for 5 seconds, followed by the answer for 3 seconds (ANSWER1.A13). Paths are allowed as indicated, but if no path is given then the images must be in the current directory. Note that the files must end in .A13 but can be listed with or without the extension. The time can range from 0 to 300 seconds, and if no time is given then the time specified when the text file is run by FLASH.EXE (explained later) is used.

The maximum number of images that can be run by the program is 2000, but these can be repeated indefinitely. Also, the program can be run many times with different sets of pictures from a batch file. Thus there is no practical limit to the animation sequences except the hard drive capacity. In the advent there are many images, SLIDES.EXE is a program for keeping track of the files and their descriptive data. This program can also manage databases on overhead transparencies and photographic slides (Byers, 1998; see end of article).

FLASH.EXE to view animations and flash cards

Once images and a text file with the image names are made, they can be viewed with FLASH.EXE. The program is run with several parameters that set the default time in seconds to display pictures, as well as whether the images will be shown in linear sequence or at random, whether the images will repeat or be shown once, and whether the viewing time per image can be changed (variable) from within the program or not (fixed). For example, a typical command line to run the program might look like:

flash piclist.txt * random 1 variable repeat

or

flash piclist.txt * linear .2 fixed once

where "flash" runs the program and uses "piclist.txt" as the text file with the images and the other words are used as indicated above. The time will be used for all images that do not specifically have a time in the piclist.txt text file. Any times for an image in the text file override the command line parameter and also do not allow changing of the time from within the program, even if the variable command is used. If the variable command has been used, then one can change the time for viewing images with the up/down cursor keys (and Page Up/Down). Pressing (Esc) exits the program.

Random viewing of images is not truly random since the program remembers the last selections up to half the number of images listed in the text file or 100, whichever is smaller, so that the same image is not presented too soon after itself (as would occur sometimes with a truly random sequence). When "answers" are to follow flash cards and random order is desired, it is best to use a linear sequence with the cards "randomized" manually by listed order in the text file. Several "randomized" sequences can be run from a batch file. When the random sequence is to be shown only once, the program randomizes the images non-redundantly so that all images are shown once (Byers, 1991, 1993, 1996b).

Batch files and image compression

The program FLASH.EXE can be run repeatedly with different lists of images from a batch file. For example, a batch file named INSECTS.BAT might contain three lines:

FLASH ANTS.1 * 0 linear fixed once
FLASH ANTS.2 * 0 linear fixed once
FLASH ANTS.3 * 0 linear fixed once

which mean that the files ANTS.1 to ANTS.3 are run in sequence and the images in each are displayed in sequence in an animation running once with no possibility for students to change the timing. However, within the file ANTS.1, for example, a line could override the duration for a single image for 2 seconds (IMAGE-5 2).

The binary format images are not compressed and thus always have 64015 bytes no matter what the colors or complexity of the picture. Compression of images can be done if the pattern of pixel colors repeats itself. PCX files are compressed to some degree but use a less efficient algorithm than GIF files (Okonski, 1992; Wegner, 1995). GIF files employ the LZW (Lempel, Ziv, and Welch) algorithm which is also used by the popular PKZIP.EXE program (PKWARE, Inc., 9025 N. Deerwood Drive, Brown Deer, WI 53223). PKZIP.EXE can compress a typical A13 file of 64K to 25% or less of the original size depending on the complexity of the picture. The resulting ZIP files can be moved between computers more easily and the PKUNZIP.EXE program uncompresses the *.ZIP files so they can be used by FLASH.EXE.

Another use of PKZIP and PKUNZIP with FLASH.EXE is seen in the following batch file:

pkunzip PICS.ZIP
FLASH piclist.txt * linear 2 variable repeat
del *.a13
del *.13p
del FLASH.EXE
del PICLIST.TXT

Here the PICS.ZIP file containing all the image and palette files, FLASH.EXE, and PICLIST.TXT (the file with the image names) is unzipped' and the program FLASH is run as indicated. After the images have been shown, DOS is used to delete all the files except PICS.ZIP. This saves disk space since many compressed files can be expanded, utilized, and then removed.

The images are loaded even faster if a hard drive disk catching utility is employed such as DOS's SMARTDRV.EXE. This program is run either before running FLASH or run in the AUTOEXEC.BAT file when booting. The fastest animation speed that can be achieved depends mainly on the hard drive speeds and use of SMARTDRV.EXE, but also the processor speed (which affects the data transfer rate). For example, the number of full-screen images per second was only 4.9 (25 MHz 386) on older systems but increased to 20.1 (100 MHz 486) or even an astounding 42.6 (233 MHz Pentium) with newer systems. The fastest speeds are also attained by using only one palette file (13P) for the first image file loaded (usually pictures are from the same source and thus the same color palette). The PCX-13.EXE program can also convert images to a standard palette.

Other programs

Netscape and Internet Explorer, web page browsers for Windows, can show full screen GIF files with the same number of colors and at higher resolutions (e.g. 640 x 480). However, usually several seconds are required for image display, especially with older computers (386 and 486). The software here will even work on 8086 and 286 computers running DOS which is not true for the web browsers. JavaScript, an objected oriented language similar to C/C++ (Goodman, 1997), can be used to produce animations and flash cards using web browser software, but the same slow loading of images applies.

The program software can be obtained as a ZIP file (FLASH.ZIP) on the internet at (http://www.wcrl.ars.usda.gov/cec/gensoft.htm). In addition, the SLIDES program can be obtained as well as TAXOKEY (software.htm) mentioned earlier.
A second set of images animates a bumble bee flying through lupin flowers near Torsby, Sweden in June. A third set pans back and forth a picture of a Norwegian fjord. The bark beetle flying through a forest, the bumble bee in lupins, and the Norwegian fjord animations can be downloaded and unzipped. The program software (FLASH.EXE) is included in the bark beetle animation set.

References

Byers, J.A. (1991) BASIC algorithms for random sampling and treatment randomization. Computers in Biology and Medicine, 21, 69-77.

Byers, J.A. (1993) Randomization algorithms in BASIC for experimental design. Computers in Biology and Medicine, 23, 167-176.

Byers, J.A. (1996a) Taxokey: A universal taxonomic key program using DOS text files and graphics. Computer Applications in the Biosciences, 12, 185-189.

Byers, J.A. (1996b) Random selection algorithms for spatial and temporal sampling. Computers in Biology and Medicine, 26, 41-52.

Byers, J.A. (1998) Database program to manage slides and images for teaching and presentations. Educational Media International, submitted.

Goodman, D. (1996) Danny Goodman's JavaScript Handbook, Foster City, California: IDG Books Worldwide, Inc.

Okonski, S. (1992) Mysteries of 16-color .PCX files revealed. BASICPro, 2, 1, 44-51.

Wegner, T. (1995) Image Lab, Corte Madera, California: Waite Group Press.

Summary

Software is presented that can convert standard PCX image files to raw binary images suitable for viewing with BASIC programming code. Another program reads a text file of a list of images to be shown and presents them in sequence for specified durations. The images can be viewed as flashcards' in random order or in animations useful in teaching. The images are displayed rapidly at full screen resolution in up to 256 colors from among 262,144 possible.

Biographical note

John Byers was educated at Colorado State University (B.S. and M.S.) and University of California at Berkeley (Ph.D.) before becoming an Associate Professor of Insect Chemical Ecology at the Swedish University of Agricultural Sciences at Alnarp. His main research interests are in insect behavior, insect- tree interactions, and chemical ecology; and in computer simulation of behavioral and ecological models.