Pillow-SIMD
raw JSON → 9.5.0.post2 verified Sat May 09 auth: no python
Pillow-SIMD is a fork of Pillow (Python Imaging Library) that adds SIMD (Single Instruction Multiple Data) optimizations for faster image processing on supporting CPUs. Current version is 9.5.0.post2, built on Pillow 9.5.0. It requires Python >=3.7 and is maintained as a drop-in replacement for Pillow with performance improvements for common operations like resizing, filtering, and color space conversion.
pip install pillow-simd Common errors
error ModuleNotFoundError: No module named 'PIL' ↓
cause Pillow-SIMD is not installed, or installed under a different name.
fix
Run 'pip install pillow-simd' to install it. The import path is always 'PIL'.
error AttributeError: module 'PIL.Image' has no attribute 'LANCZOS' ↓
cause Using an older Pillow version (<9.0) or wrong constant name. In Pillow 9.x, resampling filters are under 'Image.Resampling'.
fix
Use 'Image.Resampling.LANCZOS' instead of 'Image.LANCZOS'.
error ImportError: cannot import name 'Image' from 'PIL' ↓
cause There is a file named 'PIL.py' in your working directory that shadows the actual PIL package.
fix
Rename or remove the local 'PIL.py' file.
error OSError: cannot identify image file ↓
cause The image file is corrupted, unsupported format, or the file path is incorrect.
fix
Verify the file exists and its format is supported (JPEG, PNG, etc.). Check the path for typos.
error TypeError: function missing required argument 'size' ↓
cause Calling 'resize()' without the size argument or with wrong argument order.
fix
Use 'img.resize((width, height))' — size must be a tuple of (width, height).
Warnings
gotcha If standard Pillow is installed, installing pillow-simd will overwrite it. Both cannot coexist. Check that your environment uses pillow-simd by checking Image.__version__. ↓
fix Use 'pip install pillow-simd --force-reinstall' to ensure pillow-simd is installed. Verify with 'python -c "from PIL import Image; print(Image.__version__)"'.
gotcha Pillow-SIMD is built with specific CPU instruction sets (SSE, AVX2). If your CPU does not support them, the library will fall back to standard Pillow code. Performance gains may not be realized. ↓
fix Check CPU support using 'cpuid' or run a benchmark. If no SIMD support, consider using standard Pillow instead.
breaking Pillow-SIMD 9.5.0 is based on Pillow 9.5.0 and inherits all breaking changes from that version. Notably, some deprecated constants were removed (e.g., 'NEAREST' replaced by 'Resampling.NEAREST'). ↓
fix Use 'from PIL import Image' and reference resampling filters via 'Image.Resampling.<FILTER>' instead of bare constants.
Imports
- Image wrong
import pillow; from pillow import Imagecorrectfrom PIL import Image - ImageFilter
from PIL import ImageFilter
Quickstart
from PIL import Image
# Open an image
img = Image.open('example.jpg')
# Resize using the optimized LANCZOS filter
resized = img.resize((300, 300), Image.LANCZOS)
# Save
resized.save('output.jpg')
# For SIMD-accelerated operations, the same API works.
# Ensure you're using pillow-simd, not standard Pillow.
print('Pillow-SIMD version:', Image.__version__)