instead of rgb graywe can also have just the mean value of the redgreenand blue channels by calling image mean( the resulthoweverwill not be the same because rgb gray uses different weights for the different colors to give subjectively more pleasing result our eyes are not equally sensitive to the three basic colors image mh colors rgb gray(imagedtype=np uint plt imshow(imagedisplay the image by defaultmatplotlib will display this single-channel image as false color imageusing red for high values and blue for low for natural imagesgrayscale is more appropriate you can select it with the followingplt gray(now the screenshot is shown in grayscale note that only the way in which the pixel values are interpreted and shown has changed and the screenshot is untouched we can continue our processing by computing the threshold value thresh mh thresholding otsu(imageprint(threshimshow(image threshwhen applied to the previous screenshotthis method finds the threshold valuewhich separates the building and parked cars from the sky above