The number of pixels in an image can be calculated by multiplying pixel columns by pixel rows. The resolution of the image is described with the set of two positive integer numbers, where the first number is the number of pixel columns (width) and the second is the number of pixel rows (height), for example as 7680 by 6876. Another popular convention is to cite resolution in megapixels as the total number of pixels in the image and dividing by one million.
from my work here i am giving you the literature on mixed pixel what i have used in my work and this may help you,
Subpixel mapping (SPM) was put forward for the purpose of estimating the reasonable spatial distribution of land cover classes within a mixed pixel (Atkinson, 1997). The main theory in SPM is the spatial dependence, in which the spatial locations of subpixel classes are predicted under the coherence constraint imposed by fraction images (i.e., soft classification results) (Atkinson, 1997). Appropriate description of the dependence is the key to producing highly accurate subpixel land cover maps. Currently, two categories of approaches are widely used: (1) approaches that employ pixel-level spatial dependence, which extracts from coarse pixels, and (2) approaches that use subpixel-level spatial dependence, which is explored from neighbouring subpixels. In the first category, linear optimization (Verhoeye and De Wulf, 2002), the spatial attraction model (SAM) (Mertens et al., 2006), the back-propagation neural network (Wang et al., 2006), geometric-based method (Ge, 2013; Ge et al., 2009; Ge et al., 2014), and artificial immune systems-based method (Zhong and Zhang, 2013) were developed to utilize the dependence among pixels. The second category includes the Hopfield neural network (Tatem et al. 2002), genetic algorithm (Mertens et al., 2003), pixel-swapping algorithm (PSA) (Atkinson, 2005), and Markov random field (Kasetkasem et al. 2005; Wang and Wang 2013). Both categories of approaches can provide effective measurements of dependence at different scales and have been obtained acceptable performances in SPM. However, the first category cannot effectively maintain local details of land cover patches and may lead to isolated subpixels or linear artifacts (Wang et al., 2012a). Conversely, the second category can preserve local details but produce discontinuous patches (especially for the linear feature) though it appropriately accounts for the size of support in prediction process (Ge et al., 2014).
and for reading an image and no. of pixels you know i think in matlab like this