I read an image in matlab using
input = imread (\'sample.jpeg\');
Then I do
imhist(input);
It gives this
Histogram is useful to analyze pixel distribution in an image. Histogram plots number of pixel in an image with respect to intensity value.
img1=imread('image.jpg'); hist(img1);