Ezaldeen99 / BackgroundRemoval

Background Removal written with swift using u2net model
Apache License 2.0
203 stars 34 forks source link

Image still has background? Save as PNG #9

Closed tdsolomons closed 6 months ago

tdsolomons commented 11 months ago

I couldn't get the background less image to save. Background re-appears.

image = BackgroundRemoval.init().removeBackground(image: inputImage)

This shows image without background. Perfectly: Image(uiImage: image!)

But when I try to save, the image magically somehow still has the background.:

guard let data = image.pngData(), let url = getUrlForImage(imageName: imageName, folderName: FolderName) else {return}

do{ try data.write(to: url) }catch let error { print("Error saving image. ImageName:(imageName): (error)") }

Also when I observe the image object it still has background . (If I load a background less image from camera roll it behaves differently . It saves without background and also if I observe the object it does not has the background)

Please let me know what I'm doing wrong here.

brainfuel commented 11 months ago

I have the same issue

saiprasad1586 commented 9 months ago

Did any one find the solution for this

BollarPeter commented 6 months ago

Is there a solution for this now?

BollarPeter commented 6 months ago

Is there a solution for this now?

I found the solution in the place where there have been closed issues!!!

Ezaldeen99 commented 6 months ago

duplicates https://github.com/Ezaldeen99/BackgroundRemoval/issues/2