In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import PIL.Image
In [2]:
image = PIL.Image.open("test.png")
img = image.crop((100,20,150,70))
image
Out[2]:
In [3]:
img
Out[3]:
In [4]:
interpolations = ["nearest", "bilinear", "bicubic", "spline16",
"spline36", "hanning", "hamming", "hermite", "kaiser",
"quadric", "catrom", "gaussian", "bessel", "mitchell",
"sinc", "lanczos"]
fig, ax = plt.subplots(nrows=4, ncols=4, figsize=(16,16))
for a,name in zip(ax.flatten(), interpolations):
a.imshow(img, interpolation=name)
a.set(title=name)
In [5]:
fig, ax = plt.subplots(nrows=4, ncols=4, figsize=(11,12))
for a,name in zip(ax.flatten(), interpolations):
a.imshow(image, interpolation=name)
a.set(title=name)
In [ ]: