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

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ build
!lama_cleaner/app/build !lama_cleaner/app/build
dist/ dist/
lama_cleaner.egg-info/ lama_cleaner.egg-info/
venv/

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: def pil_to_bytes(pil_img, ext: str, exif=None) -> bytes:
with io.BytesIO() as output: 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() image_bytes = output.getvalue()
return image_bytes return image_bytes