'Get palette contents in format suitable # for the low-level
``im.putpalette`` primitive.
.. warning:: This method is experimental.'

def getdata(self):

    if self.rawmode:
        return (self.rawmode, self.palette)
    return ((self.mode + ';L'), self.tobytes())
