Closed xiaoyezi55 closed 3 years ago
Just my opinion.
https://www.remove.bg/ is a commercial product, so I believe it pre-analyzes your input image first to provide better results for different type of input. If it finds your image has a border of background of a plain color, it may just use simple algorithm or chromakey (greenscreen) to remove the background. If the input is a more generic type of image, it uses their in-house AI algorithms to detect the background.
For Rembg, it uses https://github.com/xuebinqin/U-2-Net, which is a "Salient Object Detection" AI. So it handles well with generic photos, but not suitable for some other types of images, in this case a computer-generated pattern image with a border.
My image has a border of background of a plain color, Can you recommend some simple algorithms to remove the background?
If you are using python, you should just read the image and crop it based on you border color. A quick google search gives the below, it is easy enough to customize it for your need. https://www.programmerall.com/article/47791850168/
Thanks very much
Can this issue be closed or is there a TODO here?
closed. no TODO.
input.png:
out.png is good!
input_path = 'input.png' output_path = 'out.png'
f = np.fromfile(input_path) result = remove(f) img = Image.open(io.BytesIO(result)).convert("RGBA") img.save(output_path)
input.png:
out.png is bad!