Skip to content

armgit / rembg

Public Imported from GitHub
0

Rembg is a tool to remove images background

Format

Jan Philip Göpfert02ebe4adfd83
diff --git a/rembg/bg.py b/rembg/bg.py
index 8359502..1f45017 100644
--- a/rembg/bg.py
+++ b/rembg/bg.py
@@ -37,7 +37,6 @@ def alpha_matting_cutout(
background_threshold: int,
erode_structure_size: int,
) -> PILImage:
-
if img.mode == "RGBA" or img.mode == "CMYK":
img = img.convert("RGB")
@@ -116,7 +115,6 @@ def remove(
only_mask: bool = False,
post_process_mask: bool = False,
) -> Union[bytes, PILImage, np.ndarray]:
-
if isinstance(data, PILImage):
return_type = ReturnType.PILLOW
img = data