やったこと
PIL ライブラリを使い、画像をリサイズしてみます。
確認環境
$ python
Python 3.6.2 |Anaconda custom (64-bit)| (default, Sep 21 2017, 18:29:43)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
調査
バージョン確認
$ conda list Pillow
# packages in environment at /anaconda3:
#
pillow 6.1.0 py36hb68e598_0
pil-image-resize.py
from PIL import Image
img = Image.open('./sample.jpg')
width, height = 500, 600
img = img.resize((width,height))
img.save('./sample_resize.jpg')