haar basis and grayscale compression