import matplotlib.pyplot as plt
from skimage import data, color
from skimage.transform import rescale, resize, downscale_local_mean

image=color.rgb2gray(data.astronaut())

image_rescaled=rescale(image,0.25,anti_aliasing= False)

image_resized=resize(image,(image.shape[0]//4,
                            image.shape[1]//4),anti_aliasing=True)

image_downscale=downscale_local_mean(image,(4,3))

fig,axes=plt.subplots(nrows=2,ncols=2)
ax=axes.ravel()

ax[0].imshow(image,cmap="gray")
ax[0].set_title("Original image")

ax[1].imshow(image_rescaled,cmap="gray")
ax[1].set_title("image_rescaled")

ax[2].imshow(image_resized,cmap="gray")
ax[2].set_title("image_resized")

ax[3].imshow(image_downscale,cmap="gray")
ax[3].set_title("image_downscale")

ax[0].set_xlim(0,512)
ax[1].set_ylim(512,0)
plt.tight_layout()
plt.show()
