Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4bb2639

Browse filesBrowse files
committed
replacing Image.ANTIALIAS with Image.LANCZOS for Pillow 10.0.0+ in the image compressor code
1 parent c5c955e commit 4bb2639
Copy full SHA for 4bb2639

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎python-for-multimedia/compress-image/compress_image.py

Copy file name to clipboardExpand all lines: python-for-multimedia/compress-image/compress_image.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def compress_img(image_name, new_size_ratio=0.9, quality=90, width=None, height=
2828
print("[*] Size before compression:", get_size_format(image_size))
2929
if new_size_ratio < 1.0:
3030
# 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)
31+
img = img.resize((int(img.size[0] * new_size_ratio), int(img.size[1] * new_size_ratio)), Image.LANCZOS)
3232
# print new image shape
3333
print("[+] New Image shape:", img.size)
3434
elif width and height:
3535
# if width and height are set, resize with them instead
36-
img = img.resize((width, height), Image.ANTIALIAS)
36+
img = img.resize((width, height), Image.LANCZOS)
3737
# print new image shape
3838
print("[+] New Image shape:", img.size)
3939
# split the filename and extension

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.