Make your own free website on
Kiwi's Home Page:


Merge single GIFs into an GIF89a Animation


gifmerge is based on txtmerge written by Mark Podlipec, part of XANIM distribution. Based on infos Royal Frazier's GIF89a Animation Page I improved txtmerge to gifmerge.

gifmerge uses GIF89a extensions, as well the recent developed application extensions supported by Netscape-2.0 with n-loops. For details on GIF89a see at the GIF89a Specifications.

An excerpt of the Application Extension defined by Netscape (from Understanding GIF89a):

Netscape Navigator has an Application Extension Block that tells Navigator to loop the entire GIF file. The Netscape block MUST APPEAR IMMEDIATELY AFTER THE GLOBAL COLOR TABLE OF THE LOGICAL SCREEN DESCRIPTOR. Only Navigator 2.0 Beta4 or better will recognize this Extension block. The block is 19 bytes long composed of: (note: hexidecimal equivalent supplied for programmers)
   byte   1       : 33 (hex 0x21) GIF Extension code
   byte   2       : 255 (hex 0xFF) Application Extension Label
   byte   3       : 11 (hex (0x0B) Length of Application Block 
                    (eleven bytes of data to follow)
   bytes  4 to 11 : "NETSCAPE"
   bytes 12 to 14 : "2.0"
   byte  15       : 3 (hex 0x03) Length of Data Sub-Block 
                    (three bytes of data to follow)
   byte  16       : 1 (hex 0x01)
   bytes 17 to 18 : 0 to 65535, an unsigned integer in 
                    lo-hi byte format. This indicate the 
                    number of iterations the loop should 
                    be executed.
   bytes 19       : 0 (hex 0x00) a Data Sub-block Terminator. 
As of Beta5, the iteration count is ignored and the loop is infinite (an iteration count of zero indicates infinite). I strongly suggest you code the count to be accurate, so that when iterations begin working your GIF will not need to be modified. Technically that is all that needs to be done with this block. More about looping later in the tutorial.
For more specific infos look at Royal Frazier's GIF Making: Looping.

For general approaches of animations look at Animations.


Get the UNIX tar file: gifmerge.tar V1.3 (Feb 5, 1996).


=== GIFMerge Rev 1.30 (C) 1991,1992 by Mark Podlipec
    Improvements by Rene K. Mueller 1996

Usage: gifmerge [-<r>,<g>,<b>] [-<delay>] [-l<loops>] *.gif > anim.gif

   -<r>,<g>,<b>   set transparency, ie -192,192,192, default: no transparency
   -<delay>       set delay of between images in 1/100th secs, ie -100
                  default 50 (0.5secs)
   -l<loops>      set loop counter, ie -l0 (ever) or -l1000, default no loops
You have two images like this:
   gifmerge -192,192,192 -l0 -50 perlredb.gif perlgrey.gif > perlredblink.gif
Gives you

   gifmerge -192,192,192 -l0 -50 perlredb.gif -10 perlgrey.gif > perlredblink2.gif
Gives you

Sample Animations

Sample blinking LEDs: each has 2 frames 0.5s delay

4 frames, delays: 1x 1.0s and 3x 0.1s

more coming soon ...

Complex Animations

46 frames, 0.1s delay

more coming soon ...

Let me know if you have programmed some animations with gifmerge. A gallery with GIF89 animations you find at Royal Frazier's Animation Gallery.


I noticed that the counter-loop doesn't work at Netscape2.0, has a never-ending loop if you set -lnum. Royal Frazier wrote, that Netscape-2.0 just ignors the loop counter in their version, but maybe next version 2.1 they may support it.

Also, Netscape-2.0 seems to shows the animations as busy (comets on the "N" right upper corner of your browser) as well indicates "Reading document ..." on the bottom of your browser, which both are quite distracting for readers.

When you go back to a page (using Back-Button) which has GIF89a animations with loops, Netscape2.0 does show only few pictures as animations, some are freezed.

Beside, if you leave a page with some GIF89a animations (with loops as well), to another page, Netscape-2.0 does not show the page while loading as usual.

And finally, Netscape-2.0 gets problems when two or more windows are open with GIF89a animations, you assume right: it crashs in some cases.

.... is your browser busy? I thought so! ;-)

Accesses since Feb 5, 1996: