|
@@ -241,13 +241,13 @@ def remove(
|
|
|
"""
|
|
|
if isinstance(data, bytes) or force_return_bytes:
|
|
|
return_type = ReturnType.BYTES
|
|
|
- img = Image.open(io.BytesIO(cast(bytes, data)))
|
|
|
+ img = cast(PILImage, Image.open(io.BytesIO(cast(bytes, data))))
|
|
|
elif isinstance(data, PILImage):
|
|
|
return_type = ReturnType.PILLOW
|
|
|
- img = data
|
|
|
+ img = cast(PILImage, data)
|
|
|
elif isinstance(data, np.ndarray):
|
|
|
return_type = ReturnType.NDARRAY
|
|
|
- img = Image.fromarray(data)
|
|
|
+ img = cast(PILImage, Image.fromarray(data))
|
|
|
else:
|
|
|
raise ValueError(
|
|
|
"Input type {} is not supported. Try using force_return_bytes=True to force python bytes output".format(
|