MATLAB: Counting pixel of an image

compressionimage thresholding

i have used the thresholding for image ..
the command is
length(find(abs(cw)<=50));im(length(abs(cw)<=50))=0 ;
(1)for examble 42447 coeffients made to be zero out of 65656. my doubt is whether that remaing (23089 ) pixel only present in that image or else 0 will be presented for the whole 65536 ..
(2)how to count or calculate the number of pixels present in that image ?
(3)i apply the wavelet transform.. after that i apply this can i use this threshold for compression ?
numPixelsLessThan50 = sum(sum(cw<50));