'Returns the image palette as a list.
:returns: A list of color values [r, g, b, ...], or None if the
image has no palette.'

def getpalette(self):

    self.load()
    try:
        if (bytes is str):
            return [i8(c) for c in self.im.getpalette()]
        else:
            return list(self.im.getpalette())
    except ValueError:
        return None
