将不是三通道的图像转换为三通道

This commit is contained in:
2023-12-03 17:41:25 +08:00
parent cbcbc64899
commit 3786304926

2
pp.py
View File

@@ -42,7 +42,7 @@ def download_image(url: str) -> Image.Image:
else:
response = requests.get(url)
img = Image.open(io.BytesIO(response.content))
if img.mode != 'RGB'
if img.mode != 'RGB':
img = img.convert('RGB')
return img
except Exception as e: