Reading and writing an elephant

Read and write images

import numpy as np
import matplotlib.pyplot as plt

original figure

img = plt.imread("../../../data/elephant.png")
plot elephant
<matplotlib.image.AxesImage object at 0x7f95239e8b50>

red channel displayed in grey

plot elephant
<matplotlib.image.AxesImage object at 0x7f9523ae4590>

lower resolution

img_tiny = img[::6, ::6]
plt.imshow(img_tiny, interpolation="nearest")
plot elephant

Total running time of the script: (0 minutes 0.321 seconds)

Gallery generated by Sphinx-Gallery