code: def getGraphicsControlExt(self, duration=0.1, dispose=2, transparent_flag=0, transparency_index=0):
          
  
          bb = b'\x21\xF9\x04'
          bb += bytes([((dispose & 3) << 2) | (transparent_flag & 1)])  # low bit 1 == transparency,
          # 2nd bit 1 == user input , next 3 bits, the low two of which are used,
          # are dispose.
          bb += intToBin(int(duration * 100))  # in 100th of seconds
          bb += bytes([transparency_index])
          bb += b'\x00'  # end
          return bb
docs: getGraphicsControlExt(duration=0.1, dispose=2)
  
          Graphics Control Extension. A sort of header at the start of
          each image. Specifies duration and transparancy.
  
          Dispose
          -------
            * 0 - No disposal specified.
            * 1 - Do not dispose. The graphic is to be left in place.
            * 2 -	Restore to background color. The area used by the graphic
              must be restored to the background color.
            * 3 -	Restore to previous. The decoder is required to restore the
              area overwritten by the graphic with what was there prior to
              rendering the graphic.
            * 4-7 -To be defined.