def save_image(image): import ui if isinstance(image, ui.Image): return _photos.save_ui_image(image) else: rgba_image = image if image.mode != 'RGBA': rgba_image = image.convert('RGBA') image_data = rgba_image.tostring() return _photos.save_image(image_data, image.size[0], image.size[1])
def save_image(image): rgba_image = image if image.mode != 'RGBA': rgba_image = image.convert('RGBA') image_data = rgba_image.tostring() return _photos.save_image(image_data, image.size[0], image.size[1])