Previous Page
[Previous]
Search & Find
[Find]
Next Page
[Next]

Royal Frazier's

- MIRROR sites: closer, faster, non-English -

[Home] [Introduction] [Find] [UrlMinder] [Viewing] [Software] [How to make GIF Animations] [HTML] [Smaller GIFs] [Common Problems] [GIF Bugs] [Technical] [Gallery] [About]

If you have a few minutes, please fill out the Visitor Survey. It will help in making this site better.


Constructing Animations, part three

NOTE: Due to excessive size, this tutorial is now in three parts.


Making a Animated GIF loop in Netscape 2.0

Okay. You've got your GIF, but it only plays once. You'd like it to play multiple times or continuously. Well, I can make you a little happier.

Netscape 2.0Beta4 or better recognizes a GIF Application Extension Block that will trigger looping. The GIF89a specification allows proprietary data to be embedded in a GIF file without causing confusion for other applications reading the GIF. When Netscape 2.0beta4 or better detects this extension it will load the entire GIF down to the PCs cache, then begin cycling through it from the hard disk cache. Here are some important facts about looping GIFs:

As of Netscape 2.0b4 through 2.01

As of Netscape "Atlas" 3.0 b1

How to insert the Netscape Application Block

There are a few ways to do this. Mostly depending upon the software.

For Windows 3.x and Windows95 users, GIF Construction Set version 1.0G or later will correctly insert the loop block for you. If you only have an earlier version, you will need to purchase GIFCON from Alchemy Mindworks. And NO, I can't send you registered copies and registration codes. For GIFCon 1.0G+ users, simply OPEN your GIF in GIFCON and hit INSERT. LOOP is one of the six options on the Insert Block list. Click on Loop, it will ask you for the number of iterations. The default is 1000. Read ahead for a discussion about How Many Times you should Loop.

GIF Builder (release 0.3.1 was released in early April) I understand it will insert the Loop Block for you as well and just as easily.

If you are using one of the above programs that insert the loop for you, you can skip ahead to How Many Times you should Loop.

For DOS, Windows, Mac and Unix users, you can use the GIFLOOP program I wrote, or one of the variations available to insert the Loop Block into an animated GIF. It has been translated to from DOS Basic to C, Perl, Applescript, and more.

About GIFLOOP program

A Netscape programmer provided me with the specs on this extension originally. Rather than have a bunch of people out there struggling to insert this code without messing up their GIFs, I put a DOS QBASIC program in the Software Toolbox to do this for us. There are instructions about running it there. This has been ported to a compiled C version for Solaris 2.4, and a PERL script on the Unix side, and Applescript. Some compiled versions exist, check the Software Toolbox. Now that the newest versions of GIF Construction Set, GIF Builder, WhirlGIF, and SmartDubbing support loop blocks, this program is unneeded for many users.

Programmers: If anyone writes an utility like this or more for any platform, please make this available to the net. You can FTP it to my area if need be. I will set up links to it. Send me info, if you do.

GIFLOOP is only a DOS QBASIC program. Not terribly elegant, but it works. Just get into QBASIC and load the file. RUN the program.

It will prompt you for the source file. This must be the GIF89a animation with all the frames in it. You CAN modify the animation file after the APPLICATION block is in, but it MUST BE a GIF89a file complete with a global table for this program to work. You must type the full file name with the ".GIF" extension.

It will prompt you for the destination file. This can be the same as the original, but I don't suggest it. You must type the full file name with the ".GIF" extension. If the file already exists, kiss goodbye to the old file.

ALWAYS ALWAYS ALWAYS ALWAYS have a backup of your animation file!!!

It will prompt you for the number of iterations. As of 2.0beta5 (and for the commercial release) specific numbers of iterations will be ignored. Looping is infinite or non-existent. In the future this should change. Of course the more people know about this the more attention Netscape will give this feature.

The planned looping can occur zero through 65,535 times. Zero indicates infinite looping. This can be useful in a number of ways. First off, consider that there is overhead to playing your images. When Netscape is cycling through your images, that takes processor time and slows down other things on the PC and in Netscape. Long (several second) delays in an animation alleviate this some. You could also stop the animation from cycling after a few times. This would please a lot of people as the machine will speed up its reactions when the animation stops.

How Many Times Should You Loop

Now that Netscape 3.0 supports loop iteration counts its time to stop those endlessly looping animations out there. Unless your animation is INCREDIBLY short, people probably don't want to see it more than 20 times. If your page is one that people will be reading or refering to often it can be annoying to have an animation constantly running. Here's a good test.

Open your Web Page with all those great animations. 
Leave it open and open your favorite word processor. 
Start typing a few lines. Notice any pauses...

Maybe you have the top of the line processor and don't notice the constant activity of the animations. On many machines it drains your CPU and makes multitasking slow. I try to insert a few seconds (at least) delay between loops. I also suggest stopping the animation after a good number of iterations. There is no reason to loop "infinitely". You animation isn't so wonderful that people want to watch it THAT long. It also slow the reactions of the browser on lesser machines.

This is VERY important since Atlas has disabled the browser's ability to STOP an animation. That's right...there's no stopping them with Atlas... Your browser is captive to any HTML hack who thinks a 2.5 megabyte GIF is a small animation. Mr. "I got to have more"'s page with 27 independent animations, all looping, all draining the life from your CPU, your hard drive, and your time; he's in control now. I have set a message to Netscape to reconsider this. It will make animations far more hated than the dreaded BLINK.

Looping Thoughts

Have too many animations and graphics on a page? For continuous animations that don't need to constantly play, insert a 5 second wait at the beginning or end. During this 5 second (or more) wait Netscape will concentrate on other graphics and downloads, speeding them up. This way a single animation won't constantly swallow processor time.

I noticed that for multiple repeating animation files, hitting STOP once may not be enough. After hitting STOP, it was grayed then became available again as animation started up again. This may have just be odd timing, but it has seemed to happen a few times.

2.0Betas up to b6 also have a major bug with printing. You can't. Continuous animations causes the printing process to go into loops that it never came out of. This is the reason I did not use continuous animations on any of the tutorial pages. Beta 6 fixed this problem.


That is everything that affects animated GIFs. I will amend this as I find more. Future additions will also be isolated on an addendum pages so people can find all the new info on a single page.


Troubleshooting

PROBLEM: Only the first frame of the GIF displays?

ANSWER: GIFs with timed delays never got past this point with 2.0Beta3 of Netscape Navigator. Browsers that don‘t correctly interpret GIF89A format will do this as well.

PROBLEM: The Program I use won’t SAVE in GIF format, or does it badly

ANSWER: Save the image in another bitmapped format (i.e. BMP, PCX, PICT, TIF and GIF Construction Set will convert it. I actually find GIFCON handles reducing and remapping colors well in most cases.

PROBLEM: My GIF GPFs in Netscape

ANSWER: You have frames that are wider or taller than the logical screen header defines. Increase the Logical Screen Header's width and height to include the largest dimensions of all images in the file. Or you can rework your images to conform to one size. The latter may be difficult to impossible.

PROBLEM: Going to a Web page, or closing, causes Netscape to GPF or hit a System Error.

ANSWER: A GPF existed in betas 5 and 6 that cause a GPF when going to another page or closing when animations were playing. Upgrade! This was fixed in the final version.

PROBLEM: I can't print my pages

ANSWER: Netscape 2.0 betas 3 through 5 have a problem printing pages with looping animations. Upgrade to the final version

PROBLEM: Some of the images I inserted have changed colors. Particularly, the background and whites.

ANSWER: GIF Con is having trouble mapping colors. Try reinserting those images with fifteen-bit quantize.

PROBLEM: My images jerks and slides back and forth, or up and down.

ANSWER: The individual frames are different sizes. You must adjust the top and left of each individual image to get them to line up. The alternative is to regenerate the frames with an equal-sized bounding box to act as a stable frame of reference-like a movie screen.

PROBLEM: The images flash and turn odd colors momentarily.

ANSWER: Your video card is probably running in 256 color mode. This is the most optimal color depth for video currently. 64k colors tends to be visibly slower in displaying Windows. What this means is Windows is working off of a palette (like a painters palette) of 256 colors. If the GIFS on screen have over 256 unique colors, the video driver begins swapping palettes around to compensate for the variety of colors. Eventually this causes an effect that often looks like the negative of a photo. Perhaps someone can better and more accurately explain what happens and why. The ultimate solution: Reduce the variance in colors. Yes you could change to 64k color display. However this would slow your machine down (unnecessarily in my mind) and it doesn’t make the display better on others who are browsing your page. Bitmap textures that have been applied to objects and rendered images introduce tremendous variations in color and light. This often increase the size of the GIF and the used portion of the palette. Do you need every color of the rainbow in 10 different shades? Are those gradient fills really making the images better?

PROBLEM: I enter settings in GIFCon but they disappear.

ANSWER: You’re typing [ENTER] instead of clicking on OK. [ENTER] Cancels! in early version of GIFCon. Upgrade.

PROBLEM: My GIF didn’t save in GIFCon.

ANSWER: You are using an old version of GIF Con. Upgrade. You used SAVE instead of SAVE AS when first saving it. This is a bug. !OR! You hit [ENTER} after typing the filename [ENTER] Cancels! Makes sure you use the mouse and Click OK in the old version.


Any ideas, suggestions,utilities, or examples, please mail them over for inclusion in this page.

Royal Frazier

(Go to the TOP of PAGE for MENUS)

LinkExchange
LinkExchange Member


Copyright 1996,1997 Royal E. Frazier Jr. Last Updated: March 1997