August 2005                                                                                                                               Volume 6, Issue 8

 

GIF Animations can make your IR presentations come to life

By Bernard R. Lyon Jr.
ASNT NDT Level III

To animate, in the precise sense of the word: To give life to.

--Garcia Lorca

1928. Inaugural lecture for the Granada Athenium Theater’s season, A Dream of Life (Leslie Staianton; 1998)

As trainers, we are compelled to create presentations that illustrate and explain complex concepts, clearly and concisely. The objective is to get the idea across. Thermography can be challenging, even for someone with a technical background. So, we are constantly exploring any methods, means, or media that may serve to clarify information.

Many thermographers often find themselves in similar situations, where they have to explain thermograms to their clients or management. Or, in a more relaxed environment, thermographers may contribute to the Infrared Community, by conducting a presentation at an infrared conference. Questions may arise concerning severity, colors, emissivity, or any other parameters found in images or reports. Still infrared images, accompanied with digital visuals, are certainly adequate for most thermographic inspections. However, there are always situations where a still image is not the most effective way to present the problem.

Consider, for example, rotating machinery. I can recall conducting a mechanical inspection that involved capturing thermal images of offset reciprocating flanges on a pump. One of the flanges had a hot spot on it. I captured a few still thermograms, but I could not get a single image that revealed all three flanges at once. They were not all visible at the same time. A few seconds of infrared video would have been extremely useful for this application. If I had a camcorder, VCR, or digital video recorder, I could have recorded the video output from the IR camera. Alternatively, I could have captured a sequence of images and made my own "video" in the form of an animated GIF file. Capturing video would have been the easiest method.

To capture individual stills, the camera should be placed on a surface where it will not move, or mounted on a tripod. Each individual image represents a single frame in the GIF animation. For one complete rotation of the pump flanges, I could have captured 12 images. One at the 12 o’clock position, one at the 1 o’clock position; and so on, up to 11 o’clock. These twelve stills could then be used to create the animation.

Paper documents cannot contain video or multimedia. However, keep in mind that reports are not confined to printed materials alone. PowerPoint presentations can contain video and audio files; as well as tables, spreadsheets, graphs and images. And, you do not need to have PowerPoint to view these presentations. You can download PowerPoint Viewer free from Microsoft. Therefore, any thermographer could create a report with "moving images" or "video" and distribute it for viewing. At this point, do not be concerned about the large size of most video files (AVI, MPG, MOV, RM and WMV). Remember, the plan is to create a GIF animation. One of the advantages of GIF animations is their small file size.

Gif animations are the entertaining clips that you encounter on most websites. They often repeat or "loop" continuously, such as a walking dog or a spinning globe. The parading pencils that encourage you to sign a guestbook and the energetic envelopes indicating an email address are other examples of animated gifs. Thousands of animated gifs may be downloaded for free from numerous websites. You can also create your own animations using Photoshop, Photoshop Elements, Paint Shop Pro, Microsoft GIF Animator and other image processing programs.

GIF is an acronym for Graphics Interchange Format, a bit-mapped graphics file format invented in 1987 by CompuServe. It served as an efficient means to transmit images across data networks. In the early 1990s, the original designers of the World Wide Web adopted GIF image files for their efficiency and widespread familiarity. Unlike JPEG (Joint Photographic Experts Group) image files, GIF files use a lossless compression algorithm and the images do not lose bits when they are decompressed. The image, uncompressed from the file, would be identical to the original without losing data or distorting the image. This is accomplished by using a proprietary encoding/decoding scheme, LZW (Lempel, Zev, Welch), which produces very small files in comparison to fully expanded BMP (Bitmap) files. GIF files are limited to 256 colors, or 8 bits; this was state of the art in 1990. Illustrations, cartoons, line drawings, black and white images, and non-complex limited color photographs work well as GIF images. The GIF format is somewhat less efficient at compressing complicated pictures with many colors and complex textures.

When you save an image in GIF format, you have the option to specify how many colors to save (256 or less). By doing this, you can decrease the size of an image even further. Many tools available to optimize GIF images, usually work by reducing the number of colors to the bare minimum. This can produce astounding results in reducing the size of the finished file.

The GIF89a standard included animation. This basically allows multiple images to be included in a single GIF file. In that image or, more appropriately, sequence of images, you can specify the time that each frame is shown and whether or not the animation stops or loops for a defined number of cycles, or loops continuously.

The GIF file format allows you to combine multiple GIF images into a single file to create an animation. There are a few drawbacks to this functionality, however. The GIF format applies no compression between frames. So, if you are combining eight 50-kilobyte GIF images into a single animation, you will end up with a 200 KB GIF file. This was a real concern ten years ago. With faster online connections, more powerful microprocessors and inexpensive storage media, this no longer presents any serious problem. When sent over the internet, animated GIF files stream to the user, so the frames load and play even before the entire file is downloaded. Additionally, there are no interface controls for GIF animations. They play whether you want them to or not. If continuous looping is enabled, the animations play continuously. Keep in mind that the intended use of GIF animations, with respect to this article, is for their educational and reporting value, not website glitz. Then again, any animations you create can certainly be used on your website.

Before moving onto the process of creating animated GIFs, let’s look at some of the interesting features of GIF files.

GIF graphics may be interlaced or non-interlaced. Conventional (non-interlaced) GIF files are downloaded one line of pixels at a time, from top to bottom. Browsers will display each line of the image as it gradually builds on the screen. When an interlaced GIF file is downloaded, a low quality image is displayed and the image gradually improves in quality, essentially going from fuzzy to sharp. With fast connections and powerful hardware, these "gradual" events may occur much too fast to notice. Interlacing is best for larger GIF images, such as photographs and illustrations. It is not recommended for small GIF graphics, such as navigation bars, buttons, icons, etc. The most important benefit of interlacing is that it gives the viewer a preview of the full area of the image while it is downloading into their browser.

The GIF format allows you to pick a color from the color palette and make it transparent. You can use image processing software to select the color to become transparent. Usually the color selected for transparency is the background color in the graphic. Be careful when selecting the transparent color. The transparent property is not selective. If you make a color transparent, every pixel in the image of that particular color will become transparent. This can cause unexpected results. If you had an image with blue eyes and selected that same blue as the transparent color, the background would show through the eyes. Additionally, adding transparency to a GIF graphic can produce disappointing results when the image contains antialiasing. Often image processing programs will smooth the shape by inserting pixels of intermediate colors along the shape's boundary edges. The intent of this smoothing, or antialiasing, is to improve the look of screen images by softening jagged edges. Problems may arise when you set the background color to transparent and then use the image against a different background color. The antialiased pixels in the image will still correspond to the original background color. This can produce an ugly edge around your image. Transparency works best with simple drawings or images, but it can also work with complex shapes.

GIF images can include comments, which take up space and make the image file larger. There are a number of applications available to remove or edit these comments.

Making an animated gif

Most, if not all applications that create animated GIF files, have useful instructions. These are usually found in the help file. You should read this over to get an idea of what is involved in creating your animations. A few simple modifications can often result in a noticeable improvement in the quality of your animated GIF.

First, let’s get some images.

Here are ten JPEG images of a fused cutout switch. These were taken over an extended period of time, as the switch heated up.


10 thermal images taken over a period of time

In order to create a GIF animation, you must select images that are compatible with the software application used to create the GIF animation.

If your images have a file extension that can only be used with infrared image processing programs, then you must convert them to a format that is compatible with your GIF animation program. For example, if you have IMG or TIF files, you should change them to a BMP, JPG, or GIF format.

The program that I use to create animated GIFs is Microsoft Gif Animator. All together, the ten images, (image1.jpg - image10.jpg) only use 307KB of space. I viewed and copied these to the clipboard, one at a time, using Irfanview; and pasted them into Microsoft Gif Animator. I also wanted to simulate the switch cooling down. So, after I pasted in images 1 through 10, I pasted in images 2 through 9, in reverse order. I did not have to include images 1 or 10 again because they would be repeated back to back. I selected "Optimal Palette" for my color palette and "Error Diffusion" for my import dither method. I also selected the "Looping" and "Repeat Forever" options. I did not assign a transparency to any color. For each image, I set the time duration to 6/100 sec. I previewed the animation and saved the file as "cutout anim1.gif." (If some of these terms sound strange and unfamiliar, don’t worry. This terminology is used with Microsoft Gif Animator. You probably will see different parameters with different GIF animation applications.) This animated GIF file, with 18 images, is only 302KB. And yet, the original 10 images were 307KB. The color reduction from 24 bits (JPEG) to 8 bits (GIF) is responsible for the reduction in file size. When viewed with a browser, a GIF animation editor, or an image viewing program with the capability to view GIF animations, the fuse cutout will appear to heat up and cool down rapidly. Infrared images were used to make this animation. You may also use visual images, line art, or drawings.


Disconnect animated with 10 images

You might want to start out with something easy to get the hang of it. I have included three JPG images to work with: itc1.jpg, itc2.jpg and itc3.jpg.


Three images to get you started with animated gifs

You may use these to practice with. Or, you may use any images that you have available to you. First, be sure that all of the images are the same size. You can create GIF animations with images of different sizes, but you won’t like the results. The three itc images are all 511 X 223 X 24bit JPG files. They are essentially the same, except for the color of the dot on the letter "i." If you use these three images to create a GIF animation, the dot on the letter "i" will change colors. You can select the time duration for each individual image. The animation can end after the last frame, loop for a specific number of cycles, or loop continuously. You should experiment with these settings to create an animation to your own satisfaction.


Animated ITC logo

Some Gif Animation programs can import AVI video files and create an animated GIF from the video frames. You can select the frames that you want to use, and get rid of the others. Here is such a file. It was a 30 second AVI file, about 9MB, captured with a Canon digital camera. The file was opened with Microsoft GIF Animator and 20 sequential frames were selected. The animation was set to loop continuously. When finished, the animated GIF file was 1.19MB.


Animated gif generated from an AVI file

Why, one might ask, should you bother creating animated GIF files from AVI video; considering that you can easily import video files into PowerPoint; and you don’t experience a color reduction from 24bits to 8bits. Well, there are a few good reasons. First of all, videos require CODECS (compression – decompression). If you do not have the right codecs, your video may not run correctly. Even with the correct codec, some videos do not run right because the path to the video file is too long. Secondly, video files are not embedded into PowerPoint presentations. So, if you change the location of your video file or accidentally forget to include it on your PC or storage media, your video is certainly not going to play. Gif animations do not require codecs and they are essentially the same as a picture within your PowerPoint presentation. You can even resize, rotate, flip, invert or move them. They may be placed behind objects, or have objects placed on them, such as text or arrows. And, if that is not enough, you can change the color to gray scale, black and white, washout; or, adjust the contrast and brightness of the animation. The GIF animations will run continuously within PowerPoint, but you can effectively shut them off by using the slick animation options included in PowerPoint. Two hundred and fifty six colors (8bits) are usually enough for presentation purposes. With that in mind, perhaps the only disadvantage is the fact that you can not include the sound from your videos within your GIF animations.

So, the next time you need to display movement, motion, or changing conditions for your presentation or report, consider using the versatile features offered with GIF animations.

Below are some links that may be useful. As you browse through these, you will notice that a great emphasis is placed on reducing the size of the animated GIF files. This is still an important issue with respect to graphics on websites. For illustrating reports and presentations, this should be a trivial concern.

 

For more information on codecs:

http://www.usu.edu/sanderso/multinet/definiti.html#C

http://www.jhepple.com/codecs/Default.htm

 

For optimizing / creating animated GIFs:

http://www.webreference.com/dev/gifanim/

http://www.webdiner.com/annexe/gif89/snowstp1.htm

http://members.aol.com/royalef/gifmake.htm

http://www.htmlgoodies.com/tutorials/web_graphics/article.php/3479881

http://www.netteach.com/courses/001/lectures/Unit6/lectset1.htm#tips

 

Irfanview, free image processing program that can display animated GIF files, extract all frames from animated GIFs, perform batch conversions and much more. Be sure to download the plug-ins, as well:

http://www.irfanview.com/

 

Free Microsoft Gif Animator:

http://www.jhepple.com/gif_animator.htm

Give us your feedback

How did you like this article?

Fantastic - I will recommend it to others
Very good - I learned a lot
OK
Not so hot - I didn't get much out of it

Bad - this did nothing for me


view results
 

 

 

About the Infrared Training Center 

The Infrared Training Center offers training and certification in all aspects of infrared thermography use. Our world-class training headquarters are located near Boston, Massachusetts, USA and Stockholm, Sweden and have the world's most extensive hands on laboratories for infrared applications. In addition, we have training centers around the world. Please join us in exploring the fascinating world of the infrared!

Your comments and suggestions about this newsletter are welcomed and encouraged. If you have an interesting application or case study to share, we encourage you to submit it for publication. Published articles earn credit towards IR recertification.

Please e-mail Gary Orlove or send regular mail to the Americas office.

Visit our website:


ITC Americas, BOSTON

16 Esquire Road
N. Billerica, MA 01862, USA

Tel: +1-978-901-8405
Toll free: +1-866-TRAINIR
                 (866-872-4647)
Fax: +1.978.901-8832
E-mail:
mailto:info_us@infraredtraining.com


ITC Eurasia, SWEDEN

Rinkebyvägen 19
SE-182 11 Danderyd, Sweden

Tel: +46 (0) 8 753 25 00
Fax: +46 (0) 8 753 26 01
E-mail:
mailto:itc@flir.se

 

THIS DOCUMENT IS FOR INFORMATIONAL PURPOSES ONLY. INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND. The user assumes the entire risk as to the accuracy and the use of this document. The Infrared Training Center newsletter may be copied and distributed subject to the following conditions: 1. All text and images must be copied without modification and all pages must be included; 2. All copies must contain the Infrared Training Center copyright notice and any other notices provided therein;
3. This document may not be distributed for profit

©2005 Infrared Training Center  - All rights reserved