compatible with python-pillow