Python please! Thumbnail generator function. Create a function thumbnail() which takes an RGB image as an input and outputs the downsampled RGB image according to the given compression rate using the segment averaging technique. The function should accept the following parameters:
1. image - 3D array corresponding to the input image
2. downsampling rate - an integer corresponding to the ratio between the dimensions of the original vs downsampled image. e.g. 10, 5, 3.
Test your function against a provided color image with the following downsampling rates: 5x, 10x, 20x.
NOTE: DO NOT USE a pre-existing downsampling function from a Python package.