This recipe will show how we can make simple yet effective usage of Python matplotlib library to process image channels and display the per-channel histogram of an external image.
We have provided some sample images, but the code is ready to load any image file, provided it is supported by matplotlib's
In this recipe, you will learn how to combine different matplotlib plots to achieve functionality of a simple image viewer that displays an image histogram for red, green, and blue channels.
To show how to build an image histogram viewer, we are going to implement a simple class named
ImageViewer, and that class will contain helper methods to: