Skip to content Skip to sidebar Skip to footer

Convert Images To Gif

I am attempting to convert a series of JPG files to a single animated GIF. I have done this using the Python script images2gif.py (https://pypi.python.org/pypi/images2gif/1.0.1)

Solution 1:

Edit: Only just noticed that @Jongware beat me to it in comments.

The source shows the following:

if loops==0or loops==float('inf'):
    loops = 2**16-1#bb = "" # application extension should not be used# (the extension interprets zero loops# to mean an infinite number of loops)# Mmm, does not seem to workifTrue:
    bb = "\x21\xFF\x0B"# application extension
    bb += "NETSCAPE2.0"
    bb += "\x03\x01"
    bb += intToBin(loops)
    bb += '\x00'# endreturn bb

As you can see, the application extension is always added. From a spec for the extension

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.

In short, any value will play through a multiple times. It seems the way to avoid this is to omit the extension itself.

ifloops!=1:bb="\x21\xFF\x0B"# application extension...

Post a Comment for "Convert Images To Gif"