@idchlife If you really want to create a photo from an ui.Image without passing via a temporary file, you can use Objective-C but it it is not a nice code 😂
# only to have an ui.Image
import ui
img = ui.Image.named('test:Bridge')
# Create a PHAsset from an ui.Image (not from a PIL Image)
from objc_util import *
import threading
NSBundle.bundleWithPath_('/System/Library/Frameworks/Photos.framework').load()
PHPhotoLibrary = ObjCClass('PHPhotoLibrary')
PHAssetChangeRequest = ObjCClass('PHAssetChangeRequest')
lib = PHPhotoLibrary.sharedPhotoLibrary()
def change_block():
req = PHAssetChangeRequest.creationRequestForAssetFromImage_(img)
def perform_changes():
lib.performChangesAndWait_error_(change_block, None)
t = threading.Thread(target=perform_changes)
t.start()
t.join()