home right up


Changing the Default Image Format

The example image library supplied with HIPR contains over 700 images, all in the GIF (Graphic Interchange Format) image format. GIF was chosen because it is widely used, efficient to store (it is a compressed format) and also readily converted into other formats using standard image manipulation tools.

The image viewer supplied with your hypermedia browser will almost certainly be able to display GIF images, since GIF is a very popular format on the World Wide Web, and the browsers were initially developed for that environment.

In addition it is highly likely that your image processing software will be able to read in GIF images directly since they are such a common format, so you may be able to use the image library as a starting point for further exploration of image operators without altering the image files at all.

In an ideal world that would be that. However, in practice there are multitudes of different image formats in use today, and there do exist some image processing packages that are not able to import GIF images directly. For these reasons it is sometimes necessary to convert images from GIF format into some other format. There are three main approaches that you could take.

Firstly, if HIPR works fine as a reference manual using GIF images and you only want to use a few images for input into your image processing software, then it is easiest to keep the GIF images as they are for use with HIPR and just make duplicate versions of the images you are interested in, in a different format as necessary. Software to perform this conversion is widely available, and may even be included with your image processing package. Some suggestions for converters are given in the Installation Guide. No messing around with HIPRscript is required for this approach.

Secondly, if you have the disk space, you might just consider making a duplicate image directory containing copies of all the image files in the required new format. The hypermedia version of HIPR will continue to use the GIF images, but for further exploration you can direct students to use the alternate image directory. Since converting over 700 images by hand is very tedious, it is a good idea to automate the conversion process by writing some sort of script or batch file. Since the details of how you would do this are extremely software- and machine-dependent we cannot tell you exactly what to do here.

Finally, and only pursue this route if you are aware that it involves a major amount of work, and if you really don't have enough filespace to maintain a duplicate image library in a different format, you can choose to convert all the images into another format. The disadvantage of doing that is that you also have to change every single image reference in the HIPR HTML files to reflect the new file suffix of your images (which will presumably no longer be .gif). In addition, you must ensure that your hypermedia browser is able to display that image file format and knows how to do so (consult your Netscape documentation for details of how to link image viewers to file suffixes).

If you want to take this approach then do the following:

  1. First check that all the HIPRscript utilities are installed correctly and that you are comfortable making small changes to HIPR using the HIPRscript programs as detailed under Making Changes using HIPRscript.

  2. Make sure that your hypermedia browser is capable of displaying the image format you would like to use. Normally this will involve making sure that Netscape recognizes the new image file extension as an image file and knows which viewer to spawn in order to display it. Check your browser documentation for details. Look particularly for information on mailcap and MIME types.

  3. Convert all the images into the new format. This will probably involve a change to the filename extensions of the images, but you should keep the rest of the filename the same. e.g. if you were turning the images from GIF into TIFF format, you would probably change the filename wdg2.gif into wdg2.tiff or wdg2.tif. As mentioned above you may find it useful to find some way of automating the conversion process. Be very careful that while converting images you don't accidentally lose some! It is a very good idea to maintain a backup of all the GIF files somewhere until the conversion job is entirely finished.

  4. Now edit the file hiprgen.pl in the progs sub-directory. Near the top of the file should be a line saying:

    $IMAGE_EXT = 'gif'

    Change this to reflect the new image filename extension. Do not include the `.' here. Do not change anything else. Save the file.

  5. Now regenerate every HTML file in HIPR. See Making Changes using HIPRscript for details.

  6. Test to see that it works! If it doesn't then we are afraid that you are on your own. In the worst case, however, it should be possible to return to where you started from by simply reversing the above steps.


home right up

©2003 R. Fisher, S. Perkins, A. Walker and E. Wolfart.

Valid HTML 4.0!