Adapt for Pillow from PIL.