Problem creating animated gif

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • abcd

    #1

    Problem creating animated gif

    I am using gifmaker.py from PIL v1.1.5 on python 2.4.1.

    CODE
    ----------------------------------------------------------------
    import ImageGrab, gifmaker

    seq = []

    while keepOnGoing:
    im = ImageGrab.grab( )
    seq.append(im)

    fp = open("out.gif", "wb")
    gifmaker.makede lta(fp, seq)
    fp.close()

    ---------------------------------------------------------------

    however I am getting this error:

    Exception in thread Thread-3:
    Traceback (most recent call last):
    File "c:\Python24\li b\threading.py" , line 442, in __bootstrap
    self.run()
    File "c:\foo.py" , line 10, in run
    gifmaker.makede lta(fp, seq)
    File "c:\gifmaker.py ", line 79, in makedelta
    for s in getheader(im) + getdata(im):
    File "c:\Python24\Li b\site-packages\PIL\Gi fImagePlugin.py ", line 383,
    in getdata
    ImageFile._save (im, fp, [("gif", (0,0)+im.size, 0,
    RAWMODE[im.mode])])
    KeyError: 'RGB'


    Any ideas? Basically I want to make an animated GIF out of a bunch of
    images taken using the ImageGrab module.

Working...