Advanced figures and graphics
In this section, we will show more advanced graphical features offered by Matplotlib that are related to images and maps. We will also take a look at a few other graphical libraries.
A colored N x M image can be represented as an N x M x 3 NumPy array corresponding to three N x M matrices for the red, green, and blue channels. Image processing algorithms can then be implemented efficiently with NumPy and SciPy and visualized with Matplotlib. In addition, the PIL package (Python Imaging Library) implements basic image processing routines for pictures.
imread function opens a PNG image from the hard drive and returns an N x M x 3 (or N x M x 4 if there is an alpha transparency ...