The ANTIALIAS constant was removed in Pillow 10.0.0 (after being deprecated through many previous versions). Now you need to use PIL.Image.LANCZOS or PIL.Image.Resampling.LANCZOS.

(This is the exact same algorithm that ANTIALIAS referred to - you just can no longer access it through the name ANTIALIAS.) The Lanczos filter exists since 1979 as is named as such in virtually all other picture applications/libraries (along with other interpolation filters).


Simple code example:

import PIL
import numpy as np

# Gradient image with a sharp color boundary across the diagonal
large_arr = np.fromfunction(lambda x, y, z: (x+y)//(z+1),
                            (256, 256, 3)).astype(np.uint8)
large_img = PIL.Image.fromarray(large_arr)

# Resize it: PIL.Image.LANCZOS also works here
small_img = large_img.resize((128, 128), PIL.Image.Resampling.LANCZOS)
print(small_img.size)

large_img.show()
small_img.show()

Answer from slothrop on Stack Overflow
🌐
GitHub
github.com › NixOS › nixpkgs › issues › 286931
pysol.py crashes with "module 'PIL.Image' has no attribute 'ANTIALIAS'" · Issue #286931 · NixOS/nixpkgs
February 7, 2024 - Describe the bug As above. Steps To Reproduce Steps to reproduce the behavior: Run nix-shell -p pysolfc Run pysol.py Expected behavior The application should start. Additional context Full log: ❯ p...
Author   l0b0
🌐
GitHub
github.com › Aloxaf › MirageTankGo › issues › 3
运行demo失败: AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' · Issue #3 · Aloxaf/MirageTankGo
July 4, 2023 - Traceback (most recent call last): File "/mnt/d/workspace/cocktail/MirageTankGo/MirageTankGo.py", line 55, in <module> for x in whiteImg.size), Image.ANTIALIAS) AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' 运行的依赖版本 · docopt==0.6.2 numpy==1.25.0 Pillow==10.0.0 ·
Author   cocktail18
🌐
GitHub
github.com › JaidedAI › EasyOCR › issues › 1077
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' · Issue #1077 · JaidedAI/EasyOCR
July 9, 2023 - According to (https://stackoverflow.com/questions/76616042/attributeerror-module-pil-image-has-no-attribute-antialias), new version of PIL (10.0.0) has no ANTIALIAS, as it's deprecated.
Author   ArtDoctor
🌐
GitHub
github.com › sml2h3 › ddddocr › issues › 139
出现:AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' · Issue #139 · sml2h3/ddddocr
September 5, 2023 - 在pillow的10.0.0版本中,ANTIALIAS方法被删除了,改成了LANCZOS.使用新的方法即可: 解决办法:(推荐方案二) 方案一,修改ddddocr的_init_.py文件,将其中的ANTIALIAS替换为新方法:共4处 · #改ANTIALIAS为LANCZOS image = image.resize((int(image.size[0] * (64 / image.size[1])), 64), Image.LANCZOS).convert('L') 方案二,降级Pillow的版本,比如使用9.5.0版本(先卸载,再重新安装) pip uninstall -y Pillow pip install Pillow==9.5.0
Author   zhonghai9967
🌐
GitConnected
levelup.gitconnected.com › how-to-fix-attributeerror-module-pil-image-has-no-attribute-antialias-6625683f2eab
How To Fix AttributeError: module ‘PIL.Image’ has no attribute ‘ANTIALIAS’ | Level Up Coding
January 21, 2024 - As per the error message, the Pillow module PIL.IMAGE doesn’t seem to have ANTIALIAS attribute any longer. In fact ANTIALIAS has been deprecated in the last few Pillow versions and was completely removed as of Pillow==10.0.0.
🌐
GitHub
github.com › Zulko › moviepy › issues › 2002
module 'PIL.Image' has no attribute 'ANTIALIAS' - resize.py · Issue #2002 · Zulko/moviepy
July 5, 2023 - As its dependency, Pillow version 10.0.0 is installed. Call resize function on a ImageClip. This issue is caused by the deprecation of ANTIALIAS in Pillow version 10.0.0. Reference: https://stackoverflow.com/a/76616129/4522678 ·
Author   yoichitgy
🌐
GitHub
github.com › python-pillow › Pillow › issues › 6200
About using Image.ANTIALIAS with resize (downscaling) · Issue #6200 · python-pillow/Pillow
April 11, 2022 - Hi there, I've been trying to understand how images are resized (specifically downscaled) when using Image.ANTIALIAS. I understand that a Lanczos kernel is involved, but not exactly sure how. F...
Author   mitchellwiebe
Find elsewhere
🌐
Roboflow
discuss.roboflow.com › 🤝 community help
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' - 🤝 Community Help - Roboflow
February 27, 2024 - Hello Everyone, I am working on Automatic Number plate detection problem using opencv and yolo. I am getting the below error when i pass the numpy array to easyocr readtext module and i am running this project on WSL-…
🌐
GitHub
github.com › apache › superset › issues › 25902
Trying to execute "superset compute-thumbnails" returns error: "module 'PIL.Image' has no attribute 'ANTIALIAS' when using Pillow 10.0.0+ · Issue #25902 · apache/superset
November 8, 2023 - When trying to execute "superset compute-thumbnails", I get an error: "module 'PIL.Image' has no attribute 'ANTIALIAS'". After some Googling it seems that ANTIALIAS was removed in Pillow 10.0.0 (after being deprecated through many previo...
Author   maxgillmaxgill
🌐
GitHub
github.com › sml2h3 › ddddocr › issues › 271
module 'PIL.Image' has no attribute 'ANTIALIAS' · Issue #271 · sml2h3/ddddocr
July 2, 2025 - module 'PIL.Image' has no attribute 'ANTIALIAS'#271 · Copy link · adgers · opened · on Jul 2, 2025 · Issue body actions · pillow 高版本没有这个了 · No one assigned · No labels · No labels · No projects · No milestone · None yet · No branches or pull requests ·
Author   adgers
🌐
Anintegratedworld
anintegratedworld.com › module-pil-image-has-no-attribute-antialias
module ‘PIL.Image’ has no attribute ‘ANTIALIAS’ – An Integrated World
November 6, 2023 - Something went wrong while generating the thumbnails: module 'PIL.Image' has no attribute 'ANTIALIAS' and you are trying to use Simple Photo Gallery, try running: ... This is because there is a library dependency. For more details: https://stackoverflow.com/questions/76616042/attributeerror-mod...
🌐
GitHub
github.com › SamR1 › FitTrackee › issues › 393
PIL.Image module has no attribute ANTIALIAS · Issue #393 · SamR1/FitTrackee
July 14, 2023 - trying to upload a .gpx file (and/or .zip file with several .gpx files) I got this message in the logs: 2023/07/14 05:50:56 - fittrackee - ERROR - module 'PIL.Image' has no attribute 'ANTIALIAS' Also reported here thank you (reported als...
Author   xmgz
🌐
GitHub
github.com › mpetroff › pannellum › issues › 1119
Deprecation Warning: `ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.` · Issue #1119 · mpetroff/pannellum
September 20, 2022 - DeprecationWarning: ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead. Edit: It is PIL.Image.Resampling.LANCZOS but not PIL.Image.LANZCOS, this is a relatively new feature, so changing it may break the tool for older Pillow versions.
Author   strarsis
🌐
Brainly
brainly.com › computers and technology › high school › module 'pil.image' has no attribute 'antialias' - resize.py
module 'PIL.Image' has no attribute 'ANTIALIAS' - resize.py
November 19, 2023 - The error message 'module 'PIL.Image' has no attribute 'ANTIALIAS'' indicates that the code you're using is referencing an outdated attribute from the Pillow library, which is a popular imaging library in Python.
🌐
SlideShare
slideshare.net › slideshow › attributeerror-module-pil-image-has-no-attribute-antialiaspptx › 260647629
AttributeError module PIL Image has no attribute ...
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
YouTube
youtube.com › infinetsoft solutions
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' - PYTHON - YouTube
In this tutorial I will show you how to solve the following error "AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' in PYTHON".http://www.infi...
Published   December 31, 2023
Views   2K
🌐
GitHub
github.com › JaidedAI › EasyOCR › issues › 1113
PIL.Image has no attribute 'Image.ANTIALIAS' · Issue #1113
August 15, 2023 - I have tried changing pillow version to 9.5.0 as suggested by a previous issue but it doesn't work. I also tried changing from Image.ANTIALIAS to Image.Resampling.LANCZOS that doesn't also fix the problem. The code breaks when it attempt...
Author   Simileholluwa