We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentc5c955e commit4bb2639Copy full SHA for 4bb2639
python-for-multimedia/compress-image/compress_image.py
@@ -28,12 +28,12 @@ def compress_img(image_name, new_size_ratio=0.9, quality=90, width=None, height=
28
print("[*] Size before compression:",get_size_format(image_size))
29
ifnew_size_ratio<1.0:
30
# if resizing ratio is below 1.0, then multiply width & height with this ratio to reduce image size
31
-img=img.resize((int(img.size[0]*new_size_ratio),int(img.size[1]*new_size_ratio)),Image.ANTIALIAS)
+img=img.resize((int(img.size[0]*new_size_ratio),int(img.size[1]*new_size_ratio)),Image.LANCZOS)
32
# print new image shape
33
print("[+] New Image shape:",img.size)
34
elifwidthandheight:
35
# if width and height are set, resize with them instead
36
-img=img.resize((width,height),Image.ANTIALIAS)
+img=img.resize((width,height),Image.LANCZOS)
37
38
39
# split the filename and extension