text_plain_output_1.png
from PIL import Image

import matplotlib.pyplot as plt

import numpy as np

import numpy as np # linear algebra

from PIL import Image
image = Image.open('../input/pilimages/opera_house.jpg')

import matplotlib.pyplot as plt
import numpy as np
img_arr = np.asarray(image)

img = Image.fromarray(img_arr)

image.save('opera_house.png', format='PNG')

new_img = Image.open('./opera_house.png')

"""
Current image dim width x height (640,360). thumbnail will resize the bigger dim i.e 640 to 100
and other dim will be rescaled to maintain aspect ratio.
Standard resampling algorithms are used to invent or remove pixels when resizing, and you can specify
a technique, although default is a bicubic resampling algorithm that suits most general applications
"""
new_img.thumbnail((100, 100))
print('old image dim {}  and new img dim  {}'.format(image.size, new_img.size))