FAIIH2CMIB is a rather silly acronym (yeah, just TRY and pronounce it!) for The Fully Automated, Indexing, Imagemapping, HTML-generating, 256 Color Multi-Image Browser . A better name is likely not too far in the future. ;)
FAIIH2CMIB is a program, actually a combination of shell scripts, which generates a 'catalog' of a given set of images. You supply it with directory names to search through for images, and it will construct:
The important end result is the 'table of contents' html. All you need to do is open the URL it reports at the end, and you can browse through the image directories you supplied. You can cut&paste this URL into your own html file, and you'll have a link to the 'table of contents'. In short: you type one command, and the catalog is made for you.
index - An index is an image, usually a gif (to support Mosaic(tm), pretty much), which is comprised of a series of smaller images, we'll call 'cells'. Each of these cells is a scaled-down version of its original. The effect is essentially a 'catalog' of the images. Sometimes the names of the files are printed below each cell, but in this case, the name of the file is irrelevant, as the imagemap knows which cell goes with which original image.
imagemap - An imagemap is a file used by WWW servers to map out an image, in this case an index. Each cell of the index is represented in the file as a set of coordinates representing the area of the index the cell occupies, as well as a file pointer to the actual location of the image depicted in the cell. The coordinates form a polygon, in this case a square.
When you click on the index, the server determines where your cursor was, and which polygon it was in at the time. Once it has this information, it looks to see which image is associated with that cell, and the server retrieves that file to display to your browser. Depending on what browser you're using, the picture will either appear in place of the index you were just looking at, or another program on your end will start up to handle the viewing of the image. The index will always appear within the browser as a page.
Yes, the FAIIH2CMIB can handle many graphics formats. It uses pnmindex, part of Jef Poskanzer's PNM utility package written in 1991, as well as anytopnm, modified to handle jpg formats. Here's a list of the formats supported by FAIIH2CMIB:
PBM, PGM, PPM, Rasterfile, GIF, TIFF, IFF-ILBM (many configurations), Lisp Machine Bitmaps, PC Paintbrush, and Bennet Yee "face" files. Also, by slightly modifying anytopnm and installing an additional converter, jpeg format is supported.
The cells of the index are generated to a standard 100x100 block. Since some pictures are much wider than tall, or taller than wide, the larger dimension is sized to 100, and the other ends up less than 100 pixels. This can sometimes make the image too small to really see, especially on low-res monitors, or black and white. The program allows for specification of the cell dimensions, as well as the number of cells that make up a row.
Each cell is generated from an original image, and most of the colors of that image remain. Even if the originals only had 8-bit colormaps (256 colors), each one could feasibly have a different set of colors. For instance, if you have 10 images, you could feasibly have to contend with 2560 colors. In order to display this through Mosaic(tm), which currently only supports GIF format (a format which cannot handle more than 8 bits of color), the index must be quantized, or squeezed down to 256 colors, by using approximations. As a result, some pictures in the index file might not look very good. The original, however, will have its own full original colormap, usually using some of 24 bits of color (16 million colors or so). The index is only to give you a concept of what each image looks like.
Naturally it depends on how many images you're processing. But in general, the program is SLOW. Running it on a Sparc IPC with a lot of swap space available, it processed exactly 300 images of mixed format (mostly jpg) overnight (not exactly sure how long, but 4 hours or more is a good bet). It would take less time if the index were permitted to use 24-bits of color (i.e. - converted to a jpg format from its original pnm format). Netscape, a relatively new commercial WWW browser (free to educational sites) can handle inline jpg images, but to accomodate Mosaic(tm) users, the images are converted to gif, which takes significantly longer.
It needs a good amount of swap space, depending on the size of the images you're giving it. 5 megabytes is an estimated minimum, though you might get away with less. Don't worry - you don't need to have this much space available in your account. It uses /tmp, or another specified 'temporary' directory. There's always a directory like this globally accessible somewhere at your site.
The amount of RAM it needs is dependant on the size of each image. Usually not more than a megabyte or so.
The program converts each image to a 100x100 Portable Any Map (pnm), concatenating all images in one row into one 'row-file', and deleting the other temporary files. If you're going to be doing a lot of images at once (if there are many within one directory, for instance), you might want to plan on more space. The program does not die nicely, and an error such as running out of disk space at the very end will force you to start all over.
As mentioned earlier, the program does not die nicely. Following is a list of things which could abort the program's operation:
I can now distribute this program, so long as I put the original copyright into each file. As it stands now, though, it's not quite robust enough to warrant distribution. If you want a copy of the package, email me at dragon@nmt.edu, and I'll arrange to get you one, so you can try it out (beta testers, anyone?)
Finally, the program assumes you have all the pnm utilities already installed on your system. If you want to check this, try:
man -k pnm
It also requires the presence of a conversion utility for each of the formats. SunOS 4_1_3c came with most of them, save for the jpg converter. The jpg converter, called 'djpeg', can be found in public domain. See the end of this FAQ for possible locations.
If you have an image collection of any size, and you have a WWW address, or URL, this program would be useful to you. Unless, of course, you want to keep your image tastes private. ;)
The software package that I've hacked up will be distrubuted soon, via ftp.nmt.edu's ftp directory. Stay tuned here for a link, as well as directions.
NetPBM is required to use this package. It's public domain, so you should have no problem getting it. It's rather big, though, so you might want to have your site install it on the system. You'll find the latest release of Netpbm at the following sites:
You can get djpeg and cjpeg (decompress and compress, into and from various formats) from ftp.tcp.com (and many others), /pub/jpeg/jpegsrc.v5a.tar.gz.