Questions tagged [rembg]
23 questions
0
votes
1 answer
Add white background and resize images in a folder
I want to add a white background to my transparant images (png) and resize them. The images are located in a folder. I need to do bulk work, not 1 image at the time.
I removed the background from the images first with rembg (works good) and now I…

Deidraak
- 113
- 4
0
votes
1 answer
NO_SUCHFILE ...\u2net.onnx .u2net\u2net.onnx failed. File doesn't exist , rembg
from rembg import remove
from PIL import Image
input_path = 'input.png'
output_path = 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
I get an error
sess = C.InferenceSession(session_options,…

AleksRous
- 3
- 1
0
votes
1 answer
My script works flawlessly in IDE but gives error when run in CMD
The following code takes in path to an image, removes the background, and saves it to desktop under a name the user decides:
from rembg import remove
from PIL import Image
input_path = input("Please Drag & Drop an image:") # Takes image…

Adryan Zeigler
- 79
- 6
-1
votes
1 answer
ffmpeg - stretched pixel issue
Context
I'm converting a PNG sequence into a video using FFMPEG. The images are semi-transparent portraits where the background has been removed digitally.
Issue
The edge pixels of the subject are stretched all the way to the frame border, creating…

Adunato
- 53
- 5
-1
votes
1 answer
How do i use python to remove backgrounds of multiple images?
I want to know how to remove the background of multiple images at once
I tried this:
from rembg import remove
from PIL import Image
import os
for i in os.listdir(r'C:\\Users\\Carlo Karim\\Desktop\\folder'):
input_path = r'C:\\Users\\Carlo…

Carlo Karim
- 3
- 1
-1
votes
1 answer
NameError: name 'session' is not defined
I want to remove the background and replace it with a white background and resize it for images in a folder. I only get an error.
I got the following code:
from PIL import Image
import rembg
def process(session, image, *, size=None,…

Deidraak
- 113
- 4
-2
votes
1 answer
How to remove background of jpg that was converted from a png with a transparent background? In python
The title says it all, I've tried with cv2, but it just doesn't work. I could use some online stuff but I have 100+ photos and It will take a lot of time (for the record no I didn't download stock photos and now I want to illegally do something with…

Bain Ban
- 37
- 4
-3
votes
1 answer
cv2 rembg remove function changes the color tone of the input image. How to fix it?
in this demo color is not changed : https://huggingface.co/spaces/KenjieDec/RemBG
So here my method
def remove_background(image_path):
# Read the input image
input_image = cv2.imread(image_path, cv2.IMREAD_UNCHANGED)
# Remove the…

Furkan Gözükara
- 22,964
- 77
- 205
- 342