human
Complete this python program:
def getdata(im, offset=(0, 0), **params):
assistant
#Here is the Python program you requested.

    """Legacy Method
    Return a list of strings representing this image.
    The first string is a local image header, the rest contains
    encoded image data.
    :param im: Image object
    :param offset: Tuple of (x, y) pixels. Defaults to (0,0)
    :param **params: E.g. duration or other encoder info parameters
    :returns: List of Bytes containing gif encoded frame data
    """
    class Collector(object, ):
        data = []
        def write(self, data):
            self.data.append(data)
    im.load()
    fp = Collector()
    _write_frame_data(fp, im, offset, params)
    return fp.data