Statistics for Adaptive digital image compression based on segmentation and block classification