How to find the pixel count for specific image when we will extracted some position in web Application?

In my scenario, need to extract the the image and compare with my config image file, for that need to get a count of a pixel to compare.

can any one please help me…

Not sure if I understand right but, to get the amount of pixels that your image has you just need multiply the width x height.

need to get a pixel count in a image