{"id":28044,"library":"pillow-simd","title":"Pillow-SIMD","description":"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.","status":"active","version":"9.5.0.post2","language":"python","source_language":"en","source_url":"https://github.com/uploadcare/pillow-simd","tags":["pillow","simd","image-processing","optimization","fork"],"install":[{"cmd":"pip install pillow-simd","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Pillow-SIMD is a fork. Installing pillow-simd overrides the standard Pillow package. Do not install both.","package":"pillow","optional":false}],"imports":[{"note":"The module is always 'PIL', regardless of which fork is installed.","wrong":"import pillow; from pillow import Image","symbol":"Image","correct":"from PIL import Image"},{"note":"","wrong":null,"symbol":"ImageFilter","correct":"from PIL import ImageFilter"}],"quickstart":{"code":"from PIL import Image\n# Open an image\nimg = Image.open('example.jpg')\n# Resize using the optimized LANCZOS filter\nresized = img.resize((300, 300), Image.LANCZOS)\n# Save\nresized.save('output.jpg')\n# For SIMD-accelerated operations, the same API works.\n# Ensure you're using pillow-simd, not standard Pillow.\nprint('Pillow-SIMD version:', Image.__version__)","lang":"python","description":"Basic image resize using pillow-simd. The API is identical to Pillow; SIMD optimizations are applied automatically."},"warnings":[{"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__)\"'.","message":"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__.","severity":"gotcha","affected_versions":"all"},{"fix":"Check CPU support using 'cpuid' or run a benchmark. If no SIMD support, consider using standard Pillow instead.","message":"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.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'from PIL import Image' and reference resampling filters via 'Image.Resampling.<FILTER>' instead of bare constants.","message":"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').","severity":"breaking","affected_versions":">=9.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install pillow-simd' to install it. The import path is always 'PIL'.","cause":"Pillow-SIMD is not installed, or installed under a different name.","error":"ModuleNotFoundError: No module named 'PIL'"},{"fix":"Use 'Image.Resampling.LANCZOS' instead of 'Image.LANCZOS'.","cause":"Using an older Pillow version (<9.0) or wrong constant name. In Pillow 9.x, resampling filters are under 'Image.Resampling'.","error":"AttributeError: module 'PIL.Image' has no attribute 'LANCZOS'"},{"fix":"Rename or remove the local 'PIL.py' file.","cause":"There is a file named 'PIL.py' in your working directory that shadows the actual PIL package.","error":"ImportError: cannot import name 'Image' from 'PIL'"},{"fix":"Verify the file exists and its format is supported (JPEG, PNG, etc.). Check the path for typos.","cause":"The image file is corrupted, unsupported format, or the file path is incorrect.","error":"OSError: cannot identify image file"},{"fix":"Use 'img.resize((width, height))' — size must be a tuple of (width, height).","cause":"Calling 'resize()' without the size argument or with wrong argument order.","error":"TypeError: function missing required argument 'size'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}