fix pil_to_bytes quality

This commit is contained in:
Qing
2023-02-07 21:06:31 +08:00
parent fbb278298b
commit 276676625d
2 changed files with 2 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ def numpy_to_bytes(image_numpy: np.ndarray, ext: str) -> bytes:
def pil_to_bytes(pil_img, ext: str, exif=None) -> bytes:
with io.BytesIO() as output:
pil_img.save(output, format=ext, exif=exif)
pil_img.save(output, format=ext, exif=exif, quality=95)
image_bytes = output.getvalue()
return image_bytes