def save(self, filename, imdata, **data):
if isinstance(imdata, numpy.ndarray):<EOL><INDENT>imdata = Image.fromarray(numpy.uint8(imdata))<EOL><DEDENT>elif isinstance(imdata, Image.Image):<EOL><INDENT>imdata.save(self._savepath(filename))<EOL><DEDENT>
Data may be either a PIL Image object or a Numpy array.